Six Stars

[resolved] tReplace and wildcard?

Hi,
In the tReplace search column can you use a wildcard? If so, what is the wildcard value?
Thanks
1 ACCEPTED SOLUTION

Accepted Solutions
Six Stars

Re: [resolved] tReplace and wildcard?

Hi Xdshi,
That works BUT how would I add more than one if-else to the same tMap?
row1.JobTitle.contains("Sales")?"Sales":row1.JobTitle
row1.JobTitle.contains("Surgeon")?"Physician":row1.JobTitle
Thanks
4 REPLIES
Moderator

Re: [resolved] tReplace and wildcard?

Hi,
You can use wildcard in tReplace component, such as:$, *,. Please take a look at component reference :TalendHelpCenter:tReplace with related scenario.
What's your job requirement? Could you please set an example for us?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: [resolved] tReplace and wildcard?

Hi Xdshi,
I have a column that contains Job Titles like: Area Sales Manager, Product Sales or Director of Sales. This is what I would like to do, if this column contains the word sales "sales", I want to replace the entire value such as (Area Sales Manager) to just the word "sales". Can this be done using the tReplace?
Thanks
Moderator

Re: [resolved] tReplace and wildcard?

Hi,
If we understand your requirement very well,  you can use tMap to achieve your goal.
Here is ternary if-else operator in tMap.
The expression should be:condition?(value if true): (value if false)
Please take a look at my screenshots for details
 
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: [resolved] tReplace and wildcard?

Hi Xdshi,
That works BUT how would I add more than one if-else to the same tMap?
row1.JobTitle.contains("Sales")?"Sales":row1.JobTitle
row1.JobTitle.contains("Surgeon")?"Physician":row1.JobTitle
Thanks