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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

removing unwanted charcters

Hello all,

I'm a beginner in talend. I want to pass data by removing unwanted characters present.

I'm having special character coming from source in one of my columns . I want to remove that and process the output. I tried using Treplace component. Tried even Tjavarow.

Can anybody please help me out?0683p000009Lyjf.png

Thanks in advance. 

Labels (3)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

You need tu use a regex with String.replaceAll method in a tMap or tJavaRow component like this:

row1.before.replaceAll("[^0-9\\.]", "")

Here is the result:

Démarrage du job test a 10:05 30/05/2018.
[statistics] connecting to socket on port 3820
[statistics] connected
.-------------+-----------.
|       tLogRow_49        |
|=------------+----------=|
|before       |after      |
|=------------+----------=|
|.23          |.23        |
|100          |100        |
|100.         |100.       |
|100.23abc    |100.23     |
|2000.801246…|2000.801246|
'-------------+-----------'

[statistics] disconnected
Job test terminé à 10:05 30/05/2018. [Code sortie=0]

Does this help?

View solution in original post

5 Replies
manodwhb
Champion II
Champion II

@snishtala,

 

can you try to replace with in tMap below funtion.

 

row1.column.replaceAll("a","")

or

row1.column.replace("a","")

TRF
Champion II
Champion II

You need tu use a regex with String.replaceAll method in a tMap or tJavaRow component like this:

row1.before.replaceAll("[^0-9\\.]", "")

Here is the result:

Démarrage du job test a 10:05 30/05/2018.
[statistics] connecting to socket on port 3820
[statistics] connected
.-------------+-----------.
|       tLogRow_49        |
|=------------+----------=|
|before       |after      |
|=------------+----------=|
|.23          |.23        |
|100          |100        |
|100.         |100.       |
|100.23abc    |100.23     |
|2000.801246…|2000.801246|
'-------------+-----------'

[statistics] disconnected
Job test terminé à 10:05 30/05/2018. [Code sortie=0]

Does this help?

Anonymous
Not applicable
Author

@TRF

Thanks a lot mate. It worked with little addition to the expression. I've forgot to mention that i also have some Alphabets coming in that column which i need to pass.

So as an addition to the expression i"ve inserted a-zA-Z in your expression and it worked.

So this is the final expression  

row1.before.replaceAll("[^0-9a-zA-Z\\.]", "")

 Thanks again for taking time and replying to my post.

 

 

Anonymous
Not applicable
Author

@manodwhb

I've forgot to mention that i also have some alphabets coming in that column which i need to process it to output.Thanks for replying to my post.

Vijay_K_N
Contributor
Contributor

I have source like this

 

 

email

sudhakar###!@gmail.com

manik@um%ar*@gmail.com

vijay@gmail.com

kumar@outlook.com

 

i want to differentiate the valid email data to one target and bad data is to another target 

in tmap expression filter i used this logic StringHandling.Count(row1.email,"@")==1 ,then i got valid emails but i want to remove extra special characters