Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello dear community,
I'm trying to modify data using TMAP but i have no idea how to use a IF/COUNT condition.
Input column : >>>>> Output needed :
112345 >>>>> 0000112345
11240 >>>>> 0000011240
110247 >>>>> 0000110247
142 >>>>> 0000000142
I need it to count the char and fill it with 0 or blank until it reach a given count, like 10 for this example.
Any help appreciated !
Hi
Try this expression on tMap.
String.format("%010d", row1.columnName)
Regards
Shong
Hi
Try this expression on tMap.
String.format("%010d", row1.columnName)
Regards
Shong
Hello shong,
Thanks for the help !
This is what im getting :
Data type is String only on TALEND. The excel im getting data from isnt in integer.
My data we talking about looks like :
20190-002
MA01547
I tried adding String.valueOf() but having exact same error again :
String.format("%010d",String.valueOf(row1.newColumn1))
Thanks for your knowledge
If your data is a string, try this
org.apache.commons.lang.StringUtils.leftPad(row1.columnName, 10, "0")
Hello @Shicong Hong ,
I got an error using ur last idea. Might be from a JAR files missing. I find my hapiness with StringHandling.LPAD(row1.lotfourni, 20, " ")
THANKS.