I have an XML file that is not bound by lines. It has the tags <tag1> and </tag1> that has some trashed variables from the code that generated it (I am not able to correct that right now). I would like to be able to change the characters within these tags to correct them. The characters are sometimes special.
I have this Perl one-liner to show me the contents between the tags, but now I want to be able to replace in the file what it has found.
perl -0777 -ne 'while (/(?<=perform_cnt).*?(?=\<\/perform_cnt)/s) {print $& . "\n"; s/perform_cnt.*?\<\/perform_cnt//s}' output_error.txt
Here's an example of the XML. Notice the junk chars in-between the tags perform_cnt.
<text1>120105728</text1><perform_cnt>ÈPm=</perform_cnt>
<text1>120106394</text1><perform_cnt>†AQ;4K\_Ô23{YYÔ@Nx</perform_cnt>
I need to replace these with like a 0.