I have a csv that I want to add a preceding column to and a trailing column. The trailing column is a date (manual string right now). Every time I try to get that date, it ends up replacing some text at the front of the read in data (print $0).
How can I add that info?
Sample data from stdin
UNDEFINED,1089,19.3,-0.1
awk
awk -F, '{ printf ", %, %s\n", $0,"12\/15\/2012"}'
results
, 12/15/2012 1089, 19.3, -0.1
desired results
,UNDEFINED,1089,19.3,-0.1,12/15/2012
I've even tried separating the fields into individual columns, same result. Tried triple double-quotes around the date, same results (maybe an error i can't remember). What am I doing wrong with that date?
%s
to the format specification. – Thor Feb 16 at 21:40ls -t | head -1
" | tail -n+9 | awk ..." which i can rework now that i started to use awk. – greenwar Feb 16 at 21:54