Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
MirMir
Contributor II
Contributor II

replacement of text containing symbols

Hello Everyone,

I have a text file that needs to be parse. But first, I have to replace these symbols #,{,},~ of the text file. 

For example, if I encunter '#9#' in the text I will have to replace it with 9 0's.  (According to the data compression method, # means 0 and '#9#' means 9 pcs 0.                     #9# = 000000000)

 

example text file >> TM1#9#1001035~32~57270015185}5} 

(~32~ means 32 blanks,   }5} means 5 pcs 8

 

Can you help with this replace operation? I tried the following but I can't get the output:

if(WildMatch(TXT, '*#*')>0, Replace(TXT , Right(Subfield(TXT, '#', 2), 3), Repeat(0, Right(Subfield(TXT, '#', 2), 2)))) as ..

 

best wishes,

Miray.

 

QlikView 

 

 

Labels (1)
1 Reply
marcus_sommer

I assume that this string isn't the only one which needs to be decoded else various different ones. In such scenarios it's often sensible to split the string with (multiple) subfield() functions with only two parameters which creates then n records from it - each containing a string-part. On this you may apply various applymap() and flag-fields specifying the string-parts into useful information and garbage.

- Marcus