Six Stars

tReplace not removing comma in Talend workflow

I have a workflow which i am using to remove comma sign , from the data. However its is not working. I tried un-checking "Whole word" field too, but to no avail.

Capture.JPG

  • Data Integration
1 ACCEPTED SOLUTION

Accepted Solutions
Six Stars

Re: tReplace not removing comma in Talend workflow

forge1.PNGtlogRow.PNGtmap1.PNG

 

The tReplace should work , have you tried unchecking the whole word?

 

 

13 REPLIES
Eleven Stars TRF
Eleven Stars

Re: tReplace not removing comma in Talend workflow

It should works with tMap and the following regex: 

row1.id.replaceAll(",", "")

TRF
Six Stars

Re: tReplace not removing comma in Talend workflow

Not working either. I tried that too.

Eleven Stars TRF
Eleven Stars

Re: tReplace not removing comma in Talend workflow

It does.

Here the string to change:

"a piece, of text, with undesired, commas,"

the tMap:

tReplaceAll.PNG

and the result:

[statistics] connected
a piece of text with undesired commas
[statistics] disconnected

Try again.

 

 


TRF
Six Stars

Re: tReplace not removing comma in Talend workflow

I wonder if it is because i am using tFileInputFullRow component? I tried not only on this field, but also on other fields too, yet it is not working.

Six Stars

Re: tReplace not removing comma in Talend workflow

Hi Azimulh,

 

i think tReplace working as expected.

 

i used tReplace to replace ',' with '-', please find the output below.

Starting job job_replace at 08:10 19/04/2017.

[statistics] connecting to socket on port 3842
[statistics] connected
.-----------.
|SourceData |
|=---------=|
|COL |
|=---------=|
|ABC,XYZ,123|
|ZXC,VBN,M |
|ASD,FGH,JKL|
'-----------'

.-----------.
|AfterReplace|
|=---------=|
|COL |
|=---------=|
|ABC-XYZ-123|
|ZXC-VBN-M |
|ASD-FGH-JKL|
'-----------'
[statistics] disconnected
Job job_replace ended at 08:10 19/04/2017. [exit code=0]

Regards, 

Veeranjaneyulu Boppudi
Eleven Stars TRF
Eleven Stars

Re: tReplace not removing comma in Talend workflow

If you use tFileInputFullRow, you have a single field called "line" by default, don't you?

Can you share your job (tFileInputFullRow schema and tMap)?


TRF
Six Stars

Re: tReplace not removing comma in Talend workflow

How do i share the workflow? I mean any tutorial on how to export and secondly, i do not see any filed in this discussion forum to attach anything

Eleven Stars TRF
Eleven Stars

Re: tReplace not removing comma in Talend workflow

You can attach a captured image (click on the camera when editing a post)


TRF
Six Stars

Re: tReplace not removing comma in Talend workflow

I have added the images below. Also some sample data

 

id
Shenzhen City, Guangdong, China
Rest of Hunan, China
China
Wuxi City, Jiangsu, China
Jinshan District, Shanghai, China
JingÕan District, Shanghai, China
Yangpu District, Shanghai, China

 

Capture.JPGCapture1.JPG

Eleven Stars TRF
Eleven Stars

Re: tReplace not removing comma in Talend workflow

It works for me.
Did you change the tFileInputFullRow schema?

TRF
Six Stars

Re: tReplace not removing comma in Talend workflow

Replace.PNG

 

Used data provided by you. 

 

Logic in tReplace is

Replace1.PNG

 

Regards,

Veeranjaneyulu Boppudi
Six Stars

Re: tReplace not removing comma in Talend workflow

forge1.PNGtlogRow.PNGtmap1.PNG

 

The tReplace should work , have you tried unchecking the whole word?

 

 

Six Stars

Re: tReplace not removing comma in Talend workflow

yes it worked. However, if there are 2 columns, it gives issues.