chess: (Default)
Michelle Taylor ([personal profile] chess) wrote2002-02-17 04:17 pm

(no subject)

Right.

I have a text file, with dates in American format - m(m)/d(d)/yyyy, so today is 2/15/2002. Amongst a lot of other stuff, and I'd like to keep all the otherstuff the same.
I need to make a nice stand-alone-executable program which will just swap the month and day bits of each date it comes across around. (they're all a certain number of tabs (with otherstuff between the tabs) after a newline, if that helps.) This is because Access refuses to parse American dates from linked text files if your Windows regional settings are set to UK.
Any help / ideas as to how I could get this done?

[identity profile] marble.livejournal.com 2002-02-17 08:22 am (UTC)(link)
sed 's_\([0-9]\{1,2\}\)/\([0-9]\{1,2\}\)/\([0-9]\{4\}\)_\2/\1/\3_g' I think.

[identity profile] dreema.livejournal.com 2002-02-17 11:52 am (UTC)(link)
yeek

marble talks in an alien language :)

[identity profile] jaq.livejournal.com 2002-02-18 01:52 am (UTC)(link)
Perhaps you could make Access read that column as plaintext and write a VB function to convert it, then use it in a query with the date as a calculated field.

[identity profile] phlebas.livejournal.com 2002-02-18 05:08 am (UTC)(link)
Set your regional settings to US, start Access, open file, change settings?