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?
I added the following option:
--fields-optionally-enclosed-by='"'
This solved my problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With