问题
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?
回答1:
Using Java syntax, you can easily concatenate your input data in the Tmap component:
回答2:
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;
来源:https://stackoverflow.com/questions/30913531/how-to-concatenate-two-column-in-talend-tmap