MarkF6
MarkF6

Reputation: 503

Saving output as XML

in a first step, I process some files in a python script. Since the script is unchangeable and since it prints out important information, I'd like to save it as xml. Until now, I did: python script.py > Out.xml

But: If there are signs like "&" in the output, they should be converted in xml-chars. How can I do this?

Thanks a lot!

Upvotes: 0

Views: 101

Answers (1)

kepkin
kepkin

Reputation: 1145

Either change your script to save in XML format or use sed

python script.py | sed -e "s/&/&ampamp;/" > out.xml

Upvotes: 2

Related Questions