Skip to main content

I have a table of street names in a single field in this format:

George St

Adeline Way

Parker Blvd

 

I want to split this into two fields that include, for example:

 

FIELD1 = George

FIELD 2 = St

 

I think I need to use the SubString Extractor Transformer? any ideas on the best way to go about this?

@timh​ You could use AttributeSplitter, but this would assume you don't have two part names like King Edward Blvd. 

I would use the StringSearcher with a regular expression: ^(.+) (Blvd|St|Way)$ or even  ^(.+) (.+)$

Under Advanced enter a name for the Subexpression Matches List Name. You should get two list elements per street name:

_list{0}.part	King Edward
_list{0}.startIndex 0
_list{1}.part Blvd
_list{1}.startIndex 12
name King Edward Blvd

I've attached an example workspace (FME 2022.1). You can use https://regexr.com/ to understand the details of the regex


Reply