I am trying to import a .csv file with the following characters:
Escaped by \
Lines terminated by rn
Fields Terminated by ,
Fields Enclosed by '
I have tried several variations of this and I cannot get the first column (surname) to import. The fields are enclosed by single quotes, but, when I put a single quote in the Fields enclosed by box, I get an error message against the rn. I've tried putting in double quote, but no help either. I'm not getting error messages if I leave Fields Enclosed by empty, but the surname column just won't come over. I have checked the formatting and the column is set at “general” (I've tried changing it to text, but didn't make a difference)
The first few columns are as follows:
cust_id (auto)
surname varchar (50) not null
first varchar (50) not null
First time user of this (and learning MySQL as well) and would appreciate any help you could give me.
Thanks!
Toni
[5:35:59 AM][ 20 ms] load data local infile 'C:/phpdev/www/winestore/customers.csv' into table `Winestore`.`customer` fields escaped by '\' terminated by ',' enclosed by '”' lines terminated by 'rn' ( cust_id, surname, firstname, initial, title, addressline1, addressline2, addressline3, city, state, zipcode, country, phone, fax, email, birth_date, salary )
[5:36:02 AM][ 0 ms] select * from `Winestore`.`customer` limit 0,5000