xml parsing - SED - stripping certain tags from XML file -
i have xml files littered tags this:
<?xm-insertion_mark_start author="some_author" time="20050602t125956-0500"?>
how strip such inserts? i've tried avail:
sed -e 's/<\?xm.*?\?>//g' in.xml > out.xml
instead of substitute (s) use delete (d) command of sed:
also use sed -i
(inline) this:
sed -i.bak '/<?xm.*?>/d' in.xml
using grep:
grep -v '<\?xm.*\?>' in.xml > out.xml
caution: shell utilities not best tools parsing & editing xml data.
Comments
Post a Comment