How to parse CSVs and add a column

 new new list compose Reply to this message Top page
Attachments:
+ (text/plain)

Delete this message
Author: halloleo
Date:  
To: txr-users
Subject: How to parse CSVs and add a column
Hi TXR people!

I have CSV files like this sample:


col1,col2,col3
aaa,“a,b,c“,ccc
111,222,“1,200.30“
...

and I want to string-concat the first two columns into a third column directly after the two first columns. So the result file of the sample would be:

col1,col2,col1col3,col3
aaa,“a,b,c“,“aaaa,b,c“,ccc
111,222,“111222“,“1,200.30“

How can I do this with TXR? Or is TXR not a good tool for this?

Thanks for help!