Ishti
Ishti

Reputation: 325

load data local infile ,importing csv to mysql table not working properly

I am using load data infile to import data from csv to mysql table, but data is not inserted properly,

in the csv file fields are enclosed by ", e.g. "field1","field2","field3" some fields consist of multiple lines..

here is my script..

load data local infile 'my.csv' into table mytable fields terminated by ',' enclosed by '"' lines terminated by '\n'

please help

Upvotes: 0

Views: 1909

Answers (1)

Devart
Devart

Reputation: 121922

I have tried on MySQL 5.5, it works, even if some fields consist of multiple lines.

Try to use '\r\n' as a line separator.

Upvotes: 2

Related Questions