Skip to main content
Question

I have an excel reader with an attribute in string format that contains the speed of bikes. I want to add a "0" at the begging of the values if the length of the value is less than "2". It is quite simple and easily doable in python, sql or even exc


But I cannot find the proper way to do it here. I am sure it shouldn't be complicated but I am new to FME with thousands of questions. This is just one of them 😅

4 replies

nielsgerrits
VIP
Forum|alt.badge.img+54

You are looking for the StringPadder transformer.


No. I don't want to add space to the values. I want to add a "0" at the beginning of values IF the length is less than 2. I need a conditional statement.


redgeographics
Celebrity
Forum|alt.badge.img+50
marrysharif wrote:

No. I don't want to add space to the values. I want to add a "0" at the beginning of values IF the length is less than 2. I need a conditional statement.

Yes, as @nielsgerrits​ said, you are looking fot the StringPadder. By default it pads with spaces, but you can set a custom character for the padding.

 

(do keep in mind it is technically possible, and very exciting, for a bike's speed to be in the triple digits...)


redgeographics wrote:

Yes, as @nielsgerrits​ said, you are looking fot the StringPadder. By default it pads with spaces, but you can set a custom character for the padding.

 

(do keep in mind it is technically possible, and very exciting, for a bike's speed to be in the triple digits...)

awesome! I got it


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings