Reject line having special characters on tmap

Five Stars

Reject line having special characters on tmap

Hello, 

I've been trying put a system to check special characters for all primary keys of every tables

My idea is to use tMap, i should create a routine to check if a primary key contains at least 1 special character. If yes, it won't be integrated and be rejected, its data will be kept in tHashOutput

The point is i can't find the condition by which i could check the special characters ... 

In attachment you can find the screenshot of my tMap, i should check OTI_Source. in case it contains a special character, i must put it to reject / KO

Do you have any idea about the condition i should put or another way to verify this case? 

Thank in advance

 


Accepted Solutions
Forteen Stars TRF
Forteen Stars

Re: Reject line having special characters on tmap

You can find a lot of examples for this kind of subject and definitively, regex is what you need to use.
Using Talend you may define your own routine wich will become available for all your jobs in your project.
This page may help you to define your method to search for special characters into a string https://howtodoinjava.com/regex/java-regex-allow-limit-only-alphanumeric-characters/
You can also find on the forum examples to create a routine if necessary.
Hope this helps.

TRF

All Replies
Eleven Stars

Re: Reject line having special characters on tmap

hi,

you can use java regular expressions.

Regards,

Francois Denis

Tag as "solved" for others! Kudos to thanks!

Forteen Stars TRF
Forteen Stars

Re: Reject line having special characters on tmap

You can find a lot of examples for this kind of subject and definitively, regex is what you need to use.
Using Talend you may define your own routine wich will become available for all your jobs in your project.
This page may help you to define your method to search for special characters into a string https://howtodoinjava.com/regex/java-regex-allow-limit-only-alphanumeric-characters/
You can also find on the forum examples to create a routine if necessary.
Hope this helps.

TRF
Five Stars

Re: Reject line having special characters on tmap

Thank for your reply, 

Creating a new routine seems a best method so far to resolve my question. The site you attached is quite helpful

Fresher in talend so this community is the gold mine for me 

Have a good day