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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Saravanan_Desingh

Escape \n

I have a situation here. My text has something like below.

\\nabcdefgh

Here '\n' is considered as New-Line and I'm getting the output like below (split of line).

\

abcdefgh


Is there any work around? How to escape '\n' here?

Please advise.


4 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

What will data like this be used for? If it's allowed to add a single space between the last backslash and the 'n' character, you could break the C-like interpretation of special characters. Like in:

=Replace('\\nabcdefgh', '\n', '\ n')

And note that this translation only happens at the display stage, not while manipulating data in fields.

Best,

Peter

Saravanan_Desingh
Author

Thanks, Peter. This is helpful.

It's just a text object to display some information. So, this should work.

jagan
Partner - Champion III
Partner - Champion III

Hi,

You can replace it by using Replace() like below

=Replace('\\nabcdefgh', '\n', '')

You can do this in script like below

LOAD

Replace(FieldName, '\n', '') AS FieldName,

,

,

,

FROM DataSource;


Hope this helps you.


Regards,

Jagan.

jagan
Partner - Champion III
Partner - Champion III

Hi,

If you got the answer close this thread by giving Correct and Helpful answers to the posts which helps you.

Regards,

Jagan.