Thursday, 15 May 2014

Command line: How to remove everything between two XML tags with AWK

The line below is pretty neat, it lets you remove from the command line everything located between an opening and closing XML (or HTML) tag:


awk '/<opening_tag>/,/<\/closing_tag>/ { next } 1' "tile.xml"