Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

What is the ideal way to parse an .xml file into a .csv file that I could include with my shell scripts. I know bash cant do it but I'm unsure if I should try in awk or sed. I imagine a language would be the best solution such as python but I do not know python nor have I touched it.

share|improve this question
4  
As has been argued before parsing tag structured files warrants a real parser. You could e.g. use Ruby and use Nokigiri to parse XML and the class CSV to output CSV. Also, please add a simple example of input and output so that it understandable what you expect from an answer. –  N.N. Feb 21 '13 at 16:36
    
thanks I didn't find that from my search –  Matt Feb 21 '13 at 16:41

1 Answer 1

up vote 1 down vote accepted

You could use Xmlstarlet (AKA xml) as a XSLT transformer and write a specific CSV transform as mentioned here http://stackoverflow.com/a/952389/1481060

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.