Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Add extra column in csv file

$
0
0
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:

Please use code tags when posting data and code samples!

Viewing all articles
Browse latest Browse all 16232

Latest Images

Trending Articles



Latest Images