This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |