7

Add extra column in csv file

view full story
linux-howto

http://www.unix.com – Hi guys, Can you please help me with the unix command (awk) or script to add one column at the end (as number of column in a file are not fixed) in a csv file, and the value of that column will be "abc" f.e I got a file Code: A,B,C 1,London,34, 1,Boston,54 1,Boston,78 1,Newyork,12 1,Newyork,090 2,Newyork,676 The desired result I am expecting (as shown in column D) Code: A,B,C,D 1,London,34,ABC 1,Boston,54,ABC 1,Boston,78,ABC 1,Newyork,12,ABC 1,Newyork,090,ABC 2,Newyork,676,ABC Moderator's Comments: (HowTos)