in reply to AM to 24 hours
Since you asked for a Perl one-liner, this is one (with a regular expression adapted from 0day's suggestion):
But I frankly would not use such a one-liner for anything else than a guaranteed to be a one-off task.perl -pe 's/(\d+)\/(\d+)\/(\d+)\s+(\d+):(\d+):(\d+)\s+([AP]M)/join("-" +,$3,$1,$2,($7 eq "PM"?($4+12):$4)).".". join ".",$5,$6,"0000"/e' file +.txt
|
|---|