How can I convert m/d/yyyy to YYYY-MM-DD in a CSV file?
Posted on 2011-02-25
I'm working on converting and cleansing a database dump from an older FileMaker Pro database to import into MySQL (for a web project) and need a nice tidy way to convert the date format of m/d/yyyy to YYYY-MM-DD. I know perl, sed and awk should be able to do the trick, but what I've found so far hasn't worked (definitely a syntax problem). It'd be great if your solution was a perl script that could be run as "date-fmt.pl FILENAME", but even a simple sed command would be appreciated. I'm dealing with a database that has over 230,000 entries and using OpenOffice extensions to change the format takes wayyyyy too long.