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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] tReplace advance mode regex

Hi
I trying to put together a Canadian postal code that come split in two lines, for example, input is coming from a text file:
A1A
1W9
I want this in one line: A1A1W9
I'm using regex in the tReplace advance mode:
"^(\\d)(\\n)"

But is not working.
What I'm doing wrong ?
Thanks in advance
Felix
sample.txt.txtsample.txt_20150324-0312.txt
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I could solve my issue
It really was a something I missed on my input file, it has ";" as a separator. for example a postal code would come in this form: A1A;1W9
I change my regex to
"(\\d);(\\d\\d)"

And now it's working !

View solution in original post

4 Replies
Anonymous
Not applicable
Author

If you are trying to combine validated postal code, then why don't u just Concat both parts.
Anonymous
Not applicable
Author

If you are trying to combine validated postal code, then why don't u just Concat both parts.

It's not so simple, the text is coming from a text file, and there are others values in addition to the Postal code, so I'm doing other replacements with the component (tReplace ->simple mode), for the postal code I decide to use regex, given the uniformity of the Canadian postal code.
Anonymous
Not applicable
Author

I could solve my issue
It really was a something I missed on my input file, it has ";" as a separator. for example a postal code would come in this form: A1A;1W9
I change my regex to
"(\\d);(\\d\\d)"

And now it's working !
Anonymous
Not applicable
Author

Ok thats Cool!!.. Smiley Wink