How to concatenate two column in talend tMap

ぐ巨炮叔叔 提交于 2020-05-18 05:15:20

问题


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:

enter image description here




回答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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!