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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

regex replace

Hello Everybody,
I want to use regex to mask somme caractere. For exemple, I have this model : 0000 zzzz 0000 yyyy 0000
that's mean that the 4 first positions( first bloc ) will not be replaced and also the third and the fifth.
For the second bloc, i will replace mask using "z".
For the 4th bloc, I will replace by "y".
How can I do it with talend?
thank u for help
Labels (2)
7 Replies
Anonymous
Not applicable
Author

Hi,
Could you please check the component tFileInputRegex to see if it what are you looking for?
Best regards
Sabrina
Anonymous
Not applicable
Author

Could you please show me a example coz I'm newbie in Talend.
Thank you
Anonymous
Not applicable
Author

Could somebody help me to find a solution for my problem.
Thank you
Anonymous
Not applicable
Author

hey,
try (input)------tNormalize----tSampleRow--------tReplace (or tJavaRow)
in tNormalize choose " " as separator and in tSampleRow choose line 2 and 4 with "2,4", then use tReplace or tJavaRow.
Anonymous
Not applicable
Author

or just do in a tMap
input_row.your_column.susbtring(0,6) + " " + input_row.your_column.susbtring(input_row.your_column.length()-6,input_row.your_column.length())
Anonymous
Not applicable
Author

hi,
using substring, if pattern change the result will be wrong or a bound exception.
So could be if the format is quite "static".
regards
laurent
Anonymous
Not applicable
Author

It's not a static, the model is dynamic . I managed to do that :
4567 - ZA15 - B985 - 7413 - C5D4 but it replaces juste one time!!!
How can I do it many times
Thank you