3

I have the following import:

mysqlimport --columns=column1,column2,etc --ignore-lines=1 --fields-terminated-by=, --verbose --local -u myuser -p mytable myfile.csv

I have a csv with the following:

Beatguide,company,/organization/beatguide,beatguide.me,http://beatguide.me,DEU,,Berlin,Berlin,,"",operating,"Beatguide, an electronic music events listing and discovery platform adding sound to the experience of searching for shows and club nights.",electronics|events|music,consumer electronics|events|hardware|media and entertainment|music and audio,0,,2013-01-01,,,,11-50,,,http://www.facebook.com/beatguide.me,,

You can see the short description has a comma, but is enclosed in quotes:

"Beatguide,

an electronic music events listing and discovery platform adding sound to the experience of searching for shows and club nights."

Currently, the above mysqlimport statement splits this field. What parameter do I add to the mysqlimport statement to have it respect the quotes and insert the string with the comma instead of splitting it?

1 Answer 1

3

I added the following option:

--fields-optionally-enclosed-by='"'

This solved my problem.

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.