Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
MEureka1636576605
Contributor
Contributor

Carriage return | Multiple rows in a single field

Hi team,

I have aan input file with multiple fields. Some of the fields has CR or \r in the flow so as to continue data in single field but in a new row:

Field1;Field2; Field3

​1;abc;Hello

​2;xyz;Hello\rWorld\rBye

This should eventually be fed in the table as:

Field1|Field2|Field3

​1|abc|Hello

​2|xyz|Hello

World

Bye

I tried different posts the solution doesn't seem to fit to my needs. Can someone help?

Regards,

Eureka​

Labels (3)
1 Reply
gjeremy1617088143

Hi, you can try to read the file with tFileInputRaw then you replace \r with the end of line you want :

input_row.replaceAll("\\\\r","\\n") if you want LF

input_row.replaceAll("\\\\r","\\r\\n") if you want CRLF

input_row.replaceAll("\\\\r","\\r") if you want CR

or then you can write it with tFileOutputRaw.

 

finally you can read the new file corrected.

Send me love and kudos