I'm using one-off perl -pi -e
commands to do simple search and replace from within a bash script. Most of my regexes work fine, until I get to these:
perl -pi -e 's#\<\?mso-application.*\<Table.*Rows="1"\>#\<Table\>#s' 1.xml
perl -pi -e 's#\</Table.*#\</Table\>#s' 1.xml
Please don't mind the # marks instead of slashes, I didn't want to escape even more characters. These regexes are supposed to essentially delete chunks of an XML file exported from excel, but aren't working. This seems to be because I'm using logic that applies to strings, and trying to apply it to a file (though I admit I have only a basic understanding of perl's in-place editing).
Is there an alternative way to do this (whether in perl, awk, or sed) that can be issued from within a shell script?