in reply to Convert date format in database table.
Assuming that all you need to do is edit the text file to fix the issue then something like this should do the trick
perl -pi.bak -e 's!,(\d+)/(\d+)/(\d+)\s+(\d+):(\d+),!sprintf ",%04d-%0 +2d-%02d %02d:%02d:%02d,", $3,$1,$2,$4,$5,0!ge' csv.txt # example while(<DATA>) { s!,(\d+)/(\d+)/(\d+)\s+(\d+):(\d+),!sprintf ",%04d-%02d-%02d %02d:%02d +:%02d,", $3,$1,$2,$4,$5,0!ge; print } __DATA__ blah,11/22/2003 24:07,blah blah,1/2/2003 24:07,blah __END__ # produces blah,2003-11-22 24:07:00,blah blah,2003-01-02 24:07:00,blah
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
|---|