Ask Your Question
1

Remove new line

asked 2019-04-08 14:04:42 -0500

abhinav gravatar image

updated 2019-04-08 14:24:15 -0500

metadaddy gravatar image

I am applying the field remover on a delimited file. This creates an issue with columns which contain multiline data (i.e. separated by CRLF).

Can you please help parse this value?

I could try with field replacer and replace CRLF for a column but I'm not sure how to write the string replacement value -

${str:replaceAll(f:value(), '\n', '')}

But i cant get it working correctly.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-04-08 14:25:33 -0500

metadaddy gravatar image

You're almost there - you just need to use double backslash in the regular expression:

${str:replaceAll(f:value(), '\\n', '')}
edit flag offensive delete link more

Comments

Hello, How do we make this work only for fields in different tables when using jdbc multi table origin? Field replacer returns error for f:value() for the field that doesnt exist in that tableThanks

kappapilla gravatar imagekappapilla ( 2020-01-22 14:31:15 -0500 )edit

nm, got it ${str:replaceAll(record:exists('/COMMENTS')?f:value():'','\\n', ' ')}

kappapilla gravatar imagekappapilla ( 2020-01-22 14:49:07 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-04-08 14:04:42 -0500

Seen: 146 times

Last updated: Apr 08 '19