in reply to Re^3: AM/PM to 24 hours
in thread AM to 24 hours

I took up the challenge to do this as a perl one liner, but this version is much easier to understand and build on in the future:
use Date::Manip; use Text::CSV; my $csv = Text::CSV->new; while (<>) { $csv->parse($_); my @f = $csv->fields; $f[7] = UnixDate $f[7], "%Y-%m-%d-%H.%M.%S.0000"; $csv->combine(@f); print $csv->string . "\n"; }
Output:
ID,21,11814,1,11989,150,Y,2012-10-25-23.36.25.0000,TEST ID,22,11814,1,11989,150,Y,2012-10-25-23.36.25.0000,TEST

* Should note that the example above isn't kosher as per the documentation. It will fail on embedded newlines and isn't Unicode friendly. Best to consult that documentation if this is anything other than a one-off.