manipulating a string

Hi,
I have a column of strings which looks similar to this:
12870954785267
888777666555
012837549087651
77777799999
(…)
If the length of a string is more than 13 then I need to delete this extra numbers from the front of a string. If length is less than 13 then I need to append extra 0s in front. So the output would be:
2870954785267
0888777666555
2837549087651
(…)

How can I do that?

Hello @zielinska_km,

this expression in String Manipulation node should do it:

padLeft( substr( $yourColumnName$, length($yourColumnName$) - 13), 13, "0")

First with substr() cut your string to 13 chars and then add zeroes with padleft() where needed.

Br,
Ivan

3 Likes

Thanks! That’s the correct solution.

1 Like

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