I have a csv with the following format
header1,header2,header3 data1, data2, data3 data4, data5, data6 I want to add a date column that will make the csv look like this
header1,header2,header3, date data1, data2, data3, 01/04/2017 data4, data5, data6, 01/04/2017 I tried the following awk command but it adds date in the header row as well. I am newbie with awk and do not know how to get that working
mydate=$(date) awk -v d="$mydate" -F"," 'BEGIN { OFS = "," } {$4=d; print}' input.csv > output.csv