Skip to main content

Dear FME community,

I have an attribute which has many blank spaces in the middle. I want to reduce the amount of blank spaces to only one single space (character). I'm not very fit in regular expression, so I'm hoping somebody can tell me the code for the StringReplacer. Many thanks!

Kind regards

Thomas

I managed to do this using a sequence of 2 StringReplacer transformers:

The first using regular expressions replacing \\s* by #, the second not using regular expressions replacing ## by a white space.


Hi @thomask

one more option is a single StringReplacer with regular expression. The StringReplacer parameters should be:

  • Text to Match: [<space>]+
  • Replacement Text: <space>
  • Use Regular Expressions: yes

Just a slight update based on FME 2019


Reply