coopster

msg:3782320 | 11:47 pm on Nov 7, 2008 (gmt 0) |
I would just run a perl command over it, backup the file first and/or backup the file while you run the command. This is off the top of my head, so you may want to backup your file first and you can tweak this as necessary. perl -i.bak -pe "s/\d\d(\d\d)-(\d\d)-(\d\d) (\d\d):(\d\d):\d\d/$3.$2.$1 ($4:$5)/g" dates.txt
|
phranque

msg:3782321 | 11:53 pm on Nov 7, 2008 (gmt 0) |
sed -E 's/20([0-9][0-9])-([0-9][0-9])-([0-9][0-9]) ([0-9][0-9]):([0-9][0-9]):([0-9][0-9])/\3.\2.\1 (\4:\5)/' datesandtimes.txt you can use ...[0-9]{2}... instead of ...[0-9][0-9]... in the regexp if you prefer and beware there is a y3k problem hidden in there!
|
trillianjedi

msg:3782494 | 11:55 am on Nov 8, 2008 (gmt 0) |
Brilliant guys - many thanks :) Both work. I didn't actually realise I have Perl on my Mac - might have to have a further play around with it and learn something. | y3k problem hidden in there! |
| Happy to leave that as a problem for my great great great great great grandchildren ;)
|
phranque

msg:3782539 | 2:15 pm on Nov 8, 2008 (gmt 0) |
which one is faster? =8)
|
|