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

  • June 11, 2023
  • 4 replies
  • 5 views

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+60
  • 2937 replies
  • June 11, 2023

You are looking for the StringPadder transformer.


  • Author
  • 8 replies
  • June 11, 2023

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+59
  • Celebrity
  • 3698 replies
  • June 11, 2023

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...)


  • Author
  • 8 replies
  • June 11, 2023

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