How to concatenate two column in talend tMap

22.4k Views Asked by At

I have two column SalesID (Long 10 digit) and ItemID(Varchar 6) Now I want to concatenate these two column to make a 16 digit.

For example-  SalesID = 1234567899
              ItemID  = 32X9

  Desired concatenated value should be:- 12345678990032X9

How can I achieve about output through tMap in talend?

2

There are 2 best solutions below

2
On

Using Java syntax, you can easily concatenate your input data in the Tmap component:

enter image description here

0
On

Hi you can do it using tJavaRow component put below logic into it

output_row.SALESID = input_row.SALESID;
output_row.ITEMID = input_row.ITEMID;
output_row.ITEMID_ZERO = String.format("%6s",input_row.ITEMID).replace(' ','0');

output_row.CONCATENATE = output_row.SALESID+""+output_row.ITEMID_ZERO;