LineFeed remains in Export, while replaceall is used

0
We try to replace alle LF (Ch10 or \n) and CRFL (Ch13 or \r) of a StringVariable with a | on export to .csv. In the exported files there are still some LF present. It looks like some CRLF have been replaced by LF.   Does anybody has a solution for replacing LF and CRFL in all cases?
asked
3 answers
0

Have you tried using regex?

Basically, this should do the trick;

replaceAll($StringToReplace/Input, '(\r\n|\r|\n)', ' | ')

Alternatively, you could also try with doing the linebreak in the logic itself;

replaceAll($StringToReplace/Input, '
', ' | ')

 

answered
0

The built in replaceAll method doesn’t work across lines. 

You need to use the RegexReplaceAll Java action in Community Commons.

If you start your regular expression with (?s) it will toggle multiline matching.

Good luck!

 

answered
0

Thanks for the replies, RegEx did the trick!

answered