0

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

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.