I have a CSV file on Unix and I am trying to load it thru DataStage. However, the process is failing because there are embedded newline characters in some rows which are causing those records to break into multiple lines..
For instance, the following line (in the file) is creating issues:
1,PRV1,id1,"This is
a test to
check newlines"
2,PRV2,id2,"This line is OK"
3,PRV3,id3,"This is
another example"
Here for the 1st record the string "This is a test to check newlines
" is broken into 4 lines because of embedded newlines. This needs to be a single line. Please note that the double-quotes need to be retained. However, remaining lines which do NOT have embedded newlines should be left as-is.
Hence, the desired output should be:
1,PRV1,id2,"This is a test to check newlines"
2,PRV2,id2,"This line is OK"
3,PRV3,id3,"This is another example"