I have many XML files saved in a structure like below.
#$Dummy$#<MAIN location='Loc-01'>
--- Other tags & Elements ---
</MAIN>
Notice the characters #$Dummy$#
at the beginning. this is inserted purposefully, in-order to protect any intruders parsing & reading the data out. Apart from this, rest of the data is purely xml. And the files are saved with .xml
extension. I Know how to parse xml with Element Tree
.
In this case Element Tree
throws the below error
ParseError: not well-formed (invalid token): line 1, column 2
At present we open the files with any text editor & manually remove the characters. How can I remove this code with Python
or Power Shell
. as there are 1000's of files to parse.