>I'm trying to import thousands of dated records from a
>comma delimited file into a MySQL table.  All of these
>records have the date as mm/dd/yy.  MySQL according to
>the documentation will only accept as a DATE datatype,
>dates with the year listed first.  After importing the
>data, all dates read 'March 1, 2000'.
>
>I am aware of the following choices:
>    1:  Change the DATE datatype to VARCHAR.
>    2:  Write some kind of script to rearrange the date
>        format in my .csv file.
>
>The first seems the easy way, the second I am not capable of.
>If anyone has any other suggestions I would be happy to hear them.


If you accurately represented the date format above then
sed could accomplish #2  thus:

sed -e 's;\(..\)/\(..\)/\(..\);\3/\2/\1/;' <originalFile >newFile


**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************

Reply via email to