Keeping leading zeros

Hi,

I am reading data from csv where a field has leading zeroes, but Knime drops them which causes problems for me. I didn’t find any option in csv reader to keep them.
Is there any way to add characters to the left till a given lenght?
I mean something like padding or format, in column expression node, but I couldn’t find anything so far.
Thank you

Hi @HarryKl,

in the csv reader note you can set the transformation to string, so it keeps the leading zeros.

Best regards,

Paul

3 Likes

Is there any way to add characters to the left till a given lenght?
I mean something like padding or format, in column expression node, but I couldn’t find anything so far.

The padLeft(str,size,chars) function in the String Manipulation node will do this.

Thank you, it seems that we use an earlier version of knime-desktop where the csv-reader doesn’t have this transformation tab.

Thanks a lot, it solved my problem

@HarryKl, that’s good to hear. Would you please mark this as solved? Thanks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.