Skip to content

Instantly share code, notes, and snippets.

@verajosemanuel
Last active February 8, 2021 12:45
Show Gist options
  • Save verajosemanuel/b693d26926e451cb8a9e044b69f0bbd6 to your computer and use it in GitHub Desktop.
Save verajosemanuel/b693d26926e451cb8a9e044b69f0bbd6 to your computer and use it in GitHub Desktop.
#add #xml #node to #files in #bash
for xml in OUT/*.txt; do sed -i '1 i\<xml>' $xml;done
for xml in OUT/*.txt; do sed -i -e '$a</xml>' $xml;done
# tidy
tidy -xml file.xml
# xmlstarlet
xmlstarlet -q fo -R file.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment