Skip to main content

Good day FME'ers,

I have a field containing string values which I would like to split on multiple characters. Each string contains one of more of "and", "&" and "," e.g. WORKSHOP AND PREMISES or SHOP, OFFICE AND PREMISES.

Is there a way to specify multiple characters in the delimiter or string row? The option for conditional values would be ideal here.

Thanks

Hi, firstly replace all the possible delimiters with an identical delimiter string (e.g. "__delim__") using the StringReplacer.

  • Text to Match: AND|&|,
  • Replacement Text: __delim__
  • Use Regular Expressions: yes

You can then use the AttributeSplitter to split the resulting string using "__delim__" as delimiter string.


Hi, firstly replace all the possible delimiters with an identical delimiter string (e.g. "__delim__") using the StringReplacer.

  • Text to Match: AND|&|,
  • Replacement Text: __delim__
  • Use Regular Expressions: yes

You can then use the AttributeSplitter to split the resulting string using "__delim__" as delimiter string.

This regex may be better.

\\sAND\\s|&|,


Thanks Takashi, Works a treat. It would still be nice to have this option in a single transformer though. Perhaps a list of values to separate on or a conditional using regex. E.g. IF \\d\\s ELSE ,


Thanks Takashi, Works a treat. It would still be nice to have this option in a single transformer though. Perhaps a list of values to separate on or a conditional using regex. E.g. IF \\d\\s ELSE ,

@djmcdermott, in fact, I published a transformer named "RegxAttributeSplitter". Find it in your Transformer Gallery: FME Store/Pragmatica folder.

it is possible to use wordboundaries.

Tcl flavor in fme uses \\y

so \\yAND\\y


Reply