Xml to csv

 
Thread Tools Search this Thread
# 15  
Old 03-14-2017
That's because your file has two j151 entries in each record, and, as said, each drags along a <newline> char.
Looks like you want to suppress the second entry? Still unclear.
# 16  
Old 03-14-2017
Yes, the second entry should be suppressed.
# 17  
Old 03-14-2017
Try (unsuppressed):
Code:
awk '/a001|b203|j151/ {L=/a001/; gsub (/ *<[^>]*> */, _); printf "%s%s", L?TRS:"\t", $0; TRS=ORS} END {printf RS}' file
9781328740472    Peepers    7.99    10.99

# 18  
Old 03-14-2017
Great, I know how to remove the fourth column from there. Thanks so much for your help!

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Need to read a csv and create xml - Perl Tuxidow Shell Programming and Scripting 1 04-24-2018 03:26 PM
Splitting CSV into variables then to XML file jeffs42885 Shell Programming and Scripting 15 07-27-2017 04:34 PM
XML to CSV pareshkp Shell Programming and Scripting 6 12-02-2014 01:24 PM
How to convert xml to csv ? rspwilliam Shell Programming and Scripting 1 11-16-2014 07:07 AM
XML to TXT or CSV A-V UNIX for Dummies Questions & Answers 7 05-16-2012 01:10 PM
Convert xml to csv dineshydv Shell Programming and Scripting 7 01-19-2012 04:14 AM
awk convert xml to csv research3 Shell Programming and Scripting 6 06-08-2011 12:40 PM
XML to CSV specific mohan705 Shell Programming and Scripting 4 09-19-2010 11:48 AM
urgent help to convert xml to xsl or csv umapearl UNIX for Dummies Questions & Answers 9 03-02-2010 02:34 AM
XML to csv transformation siba.s.nayak Shell Programming and Scripting 2 08-14-2009 06:15 AM
Convert XML to CSV format kumar04 Shell Programming and Scripting 2 07-31-2009 02:07 AM
CSV processing to XML angel2008 Shell Programming and Scripting 9 06-09-2009 06:04 AM
CSV to XML pjanakir Shell Programming and Scripting 15 05-12-2009 05:50 AM
Parse XML file into CSV with shell? Pcushing Shell Programming and Scripting 7 04-14-2009 11:27 PM
Help to convert XML to CSV rossingi_33 Shell Programming and Scripting 2 02-22-2008 07:18 AM