in reply to Re: loading csv files into MySQL databse
in thread loading csv files into MySQL databse

I second this. LOAD DATA is really the best way to do this if it will work with your data format. It is more flexible than PG's COPY too (see REPLACE and IGNORE). If it doesn't work take a look at Text::CSV which is probably the best CSV library ever.


Evan Carroll
I hack for the ladies.
www.EvanCarroll.com
  • Comment on Re^2: loading csv files into MySQL databse

Replies are listed 'Best First'.
Re^3: loading csv files into MySQL databse
by Anonymous Monk on May 16, 2008 at 23:37 UTC

    Get a mysql shell prompt and issue a command like:

    mysql> LOAD DATA INFILE '/path/to/mtp4date.csv' REPLACE INTO TABLE vot +ers FIELDS TERMINATED BY ','