CSV files into mysql

Associate
Joined
19 Jul 2006
Posts
1,847
having a slight problem putting inporting a csv file into mysql.
I have the DB and table created with the right rows ect done.

but the csv file is in the form
fwefwe,rwefewfwe,fwefwefe,fewf,fwe,

So when it asked for Feilds terminated by i put ,
but how do i get it to recognise the end of the line which at the moment is set to auto, but is not picking it up as the end of each line is a , to?

Or how would i go about getting rid of the , at the end of the line. As find and replace will change everyone.

TIA

Edit: sorted i added a extra field in the DB and that then worked just adding a blank value into the field. i then deleated the field after the import
 
Last edited:
Use a text editor that supports regular expressions in their find/replace tool. Notepad++ is a good free one.

Then search for:

Code:
,$

and replace it with nothing (making sure that you're searching with regular expressions, not just a regular search). That should delete all the commas that are at the end of a line.
 
Back
Top Bottom