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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

replace lf with space but not cr

Is there any way in Talend to replace a lf (linefeed) character with a space but not affect cr (Carriage return)?
I've tried to modify the input field in my tmap with replacing \n with a space with no change. I've also tried the tReplace searching for \n to replace with a string with no change.

the input text would be something like with | as a separator
field1 | field2| field3 some textLF
more textLF
more text|field4 | field5 CR


which I would like to see in the format of
field1 | field2| field3 some text more text more text|field4 | field5 CR

Labels (4)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

Use tFileInputFullRow to read the input file with \r for the row separator and line.replaceAll("\\n", " ") to replace \n all by spaces.
It should work (maybe \n istead of \\n).

View solution in original post

1 Reply
TRF
Champion II
Champion II

Use tFileInputFullRow to read the input file with \r for the row separator and line.replaceAll("\\n", " ") to replace \n all by spaces.
It should work (maybe \n istead of \\n).