Ask Your Question
3

How to remove '\n' from the result dataset

asked 2018-01-16 04:32:13 -0500

Shruthi gravatar image

updated 2018-01-29 07:11:14 -0500

I am fetching data from customer table using JDBC query consumer. My data contains many fields and one of the field is 'Address' of customers. When i fetch these data i get '\n' in my output file specifically in 'Address' field

i.e, My fields appear like as shown below,

Name |Age |Address

A        10        104,1st cross
                   20th main road,
                   xxxx

In my destination file it appears like

Name |Age |Address

A        10         104,1st cross \n 20th main road,xxxx

How can i remove that '\n' from my output file?

Thanks in advance

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
5

answered 2018-01-16 10:58:28 -0500

todd gravatar image

You could try adding and configuring an Expression Evaluator stage which parses and updates the Address field

Output Field could be /Address or a new field such as /NewAddress

and Field Expression

${str:replaceAll(record:value('/Address'), str:unescapeJava('\\\\n'), "")}

Ref: https://issues.streamsets.com/browse/...

edit flag offensive delete link more

Comments

1

It worked.. Thank you so much

Shruthi gravatar imageShruthi ( 2018-01-16 23:39:05 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-01-16 04:32:13 -0500

Seen: 99 times

Last updated: Jan 29