Skip to content

Instantly share code, notes, and snippets.

View jbelmaro's full-sized avatar

jbelmaro jbelmaro

  • Madrid
  • 07:21 (UTC +02:00)
View GitHub Profile
@Remiii
Remiii / xml-split.awk
Last active September 24, 2018 10:50
AWK - split XML subnodes into separate files
# This awk script splits an XML file and exports X nodes into separate file
# It doesn't work if the main node has an attribute
# It doesn't work if the main node contains a subnode with the same tagname, etc.
# Use at your own risk, think before using.
# Usage:
# - Replace "myNumberOfNodesByOutputFile" by your number of nodes by output file
# - Replace "myChildNode" by your tag
# - Replace "myParentNode" by your parent tag
# Run:
# $ awk -f xml-split.awk myXML.xml