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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Moe1
Contributor II
Contributor II

How to do this

I have a column that has either 1 ID or a combination of of 2 or more IDs separated by empty spaces or dash or (dash and space) or any symbol , example below

8546

2549-98521

1235 - 1245- 4799/56478 - 241336

1225 / 25698

3698775

etc....

 

I want to separate the IDs in a way to have each ID on a separate row...

 

Thanks

 

Labels (2)
8 Replies
Anonymous
Not applicable

Hi,

Here is a component tNormalize which normalizes the input flow following SQL standard.

https://help.talend.com/display/TalendComponentsReferenceGuide63EN/tNormalize

Let us know if it is OK with you.

Best regards

Sabrina

Moe1
Contributor II
Contributor II
Author

Great mate, it worked but I still got one question:

How do I add more separators in case I have different separators in my rows as described above in my original question?

Anonymous
Not applicable

Hi,

Could you please show us your expected result here?

 

Best regards

Sabrina

TRF
Champion II
Champion II

Hi,

Use replaceAll to remove/replace undesired separators before to go with tNormalize:

0683p000009LtnO.png

Regards,

 

Moe1
Contributor II
Contributor II
Author

Thank you TRF, I will try it in case the tnormalize did not work for multiple special characters (separators). 

 
Moe1
Contributor II
Contributor II
Author

example:

45896-151315=988778

231154/54564

54564-4544

121212

 

Result:

45896

151315

988778

231154

54564

54564

4544

121212

 

NOTE: the separator is not known to me as it might be any special character or a combination of (space and special character).

vboppudi
Partner - Creator III
Partner - Creator III

Hi Moe,

You can achive this by using tJavaRow and tNormalizer.

SRC-->tJavaRow-->TNormalizer-->tLogRow

 

0683p000009LtkK.png

 

Code in tJavaRow: output_row.COL=input_row.COL.replaceAll( "[^\\d]", " " );

 

tNormalizer:

 0683p000009Ltud.png

OutPut:

[statistics] connecting to socket on port 3762
[statistics] connected
.------.
|outPut|
|=----=|
|COL |
|=----=|
|45896 |
|151315|
|988778|
|231154|
|54564 |
|54564 |
|4544 |
|121212|
'------'

[statistics] disconnected
Job job_MultiDelimiterSplit ended at 07:07 25/04/2017. [exit code=0]

 

Regards,

 

Moe1
Contributor II
Contributor II
Author

Thank you vboppudi, and thank you all. It seems Im getting good results.