Dhruuv Dhruuv - 2 years ago 87
Linux Question

Is it possible to add an empty column with no values in the beginning of a .CSV file?

How do I add an empty column at the beginning of a .CSV file using

? I am trying the following code, but that doesn't help.

awk '{",",print $0}' file1.csv > file2.csv

Please help...

Answer Source

Another awk

awk '{print ","$0}' file1.csv > file2.csv


awk '{$0=","$0}1' file1.csv > file2.csv
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download