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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
anitha_manohar
Contributor
Contributor

tNormalize not working with item separator as "\n"

Hi,

I'm trying to use tNormalize with item separator as "\n" for the string "username:test\npassword:testpwd\nerroremail:sample@email.com\nserviceno:testserv\ncarrier:\nstart:"

If I hardcode the string and assign it to a variable in tSetGlobalVar or tJava, the Normalization works and I'm getting the output as expected .

  username:test

  password:testpwd

  erroremail:sample@email.com

  serviceno:testserv

  carrier:

  start:

But If I read that value from the Oracle DB and then assign it to a variable

in tSetGlobalVar, then the Normalization doesn't work.

and the result is :

username:test\npassword:testpwd\nerroremail:sample@email.com\nserviceno:testserv\ncarrier:\nstart:If I try to add escape character while reading from the DB "select REPLACE(VALUE1,'\\n','\\\n') as VALUE_TXT from TABLE" , Normalization works , but with extra \ at the end of the line. ("\\n" doesn't work.)

  username:test\

  password:testpwd\

  erroremail:sample@email.com\

  serviceno:testserv\

  carrier:\

  start:

My requirement is to read the value from the DB , Normalize it and then write it to a file.

I'm not sure how to escape the "\" in the tNormalize.

Could someone please help to resolve this.

 

Thanks in advance.

  

Labels (3)
3 Replies
gjeremy1617088143

Hi , you can use : "\\\\n" as item separator in the tNormalize component and don't use csv parameters in advance settings. --> "\\\\" will escape \ char and "n" add the "n" char to it. So it will use the string \n as separator instead of the \n newline

Send me Love and kudos

anitha_manohar
Contributor
Contributor
Author

Hi,

 

Thank you so much. Its working now after adding "\\\\n"  as item separator.

gjeremy1617088143

U're welcome