I have many csv file in which I need to manipulate the first field which contains the date and then print the rest of the line. The files have varying field lengths.
My sample line is
"11.07.2016 00:00:00",DON1SOE02,PAPN,PAPN,OPEN1000,918945,
I have tried the code below
awk -F"," '{print "\""substr($1,08,4)"-"substr($1,5,2)"-"substr($1,2,2)substr($1,12,9)"\","$0""}' file.csv
The result of this is
"2016-07-11 00:00:00","11.07.2016 00:00:00",DON1SOE02,PAPN,PAPN,OPEN1000,918945,
Is there any way to avoid printing the unmodified date field, i.e. "11.07.2016 00:00:00"
solution below has a way to skip the first column, but I would like to modify the first column then print the modification and then skip printing unmodified first column