naryl: > I think this will suffice: > $ sed 's/<[^>]*>//g; /^$/d' < data | sed 'N; N; N; N; N; N; s/\n/ /g'
A Python version a little more resilient to changes in that file: from xml.dom.minidom import parse results1 = parse("results.xml").getElementsByTagName("results") results = results1[0].getElementsByTagName("result") # print field names (assuming a tidy XML file) for node in results[0].childNodes: if node.nodeType != node.TEXT_NODE: print node.localName, print # print data for result in results: for node in result.childNodes: if node.nodeType != node.TEXT_NODE: print node.firstChild.data, print Bye, bearophile