brianmhess / cassandra-loader

Delimited file loader for Cassandra
Apache License 2.0
197 stars 93 forks source link

Error on Loading CSV with newlines in text #43

Closed guenhter closed 8 years ago

guenhter commented 8 years ago

Hi,

I have a Column in the MySql Database which contains linebreak. When I export the table, that newline's are escaped with '\' and the file actually contains a line break. e.g.

2,"DE","0000099593A57021F5B447D06EF5B52E","Von Horace G.  Shooting, Vol. 2\
\
Shooting  for this title.\
\
About the Publisher\
\
Forgotten books. Find more at \
", ... other columns

Would it be possible, to support this too?

regards Guenther

brianmhess commented 8 years ago

Are you saying that you have actual newlines in the data that are not escaped?

guenhter commented 8 years ago

Yes, this is the case when I export with MySql. In that case \ is used for escaping as shown in the example above.

brianmhess commented 8 years ago

Newlines need to be escaped. That is converting '\n' to "\n". cassandra-loader delimitation records by newlines, so actual new line characters in the middle of records will cause trouble.

guenhter commented 8 years ago

I will re-check this, if it is possible in mysql to quote this that way