Saturday, 3 January 2015

Convert XML to CSV with xmlstarlet using double quotes on value



This shows how to convert xml to CSV


http://ift.tt/1pWrikI



xmlstarlet \
sel -T -t -m /root/record \
-v "concat(@id,';',object/keyF,';',object/keyG)" \
-n test.xml


However, some of my values have have commas in the value. How do I get my CSV to parse correctly? Is there a way to add double quotes to the KeyF value? If so, what would be the syntax?


No comments:

Post a Comment