java - Mongoexport - Issue with "\n" -
i trying export data mongo oracle. used below approach.
step 1 : export data cs file usign mongoexport command. step 2 : read data through java code, necessary data transformation. step 3 : insert data oracle
issue that, when of comment section has new line character ('\n'), data moving next line , java read fails process document.
there open bug 10gen this, jira. has 1 faced issue. there workaround ?
as many formatting nuances in csv, there no agreed "standard" how handle embedded newline characters in csv field.
a common implementation rfc-4180: common format , mime type comma-separated values (csv) files, suggests:
6) fields containing line breaks (crlf), double quotes, , commas should enclosed in double-quotes. example: "aaa","b crlf bb","ccc" crlf zzz,yyy,xxx
this format mongoexport
using. if use csv parser compliant rfc-4180 (eg. supercsv suggested @evanchooly) should handle quoted newlines expected.
if need alternative format used mongoexport
or need more flexibility in output, can write own export script.
Comments
Post a Comment