Skip to main content
Question

split an attribute into numbers and characters


Dear all, starting to really make use of and learning FME and loving it! However I am getting stuck on a seemingly simple task: I have a land title attribute which may look like TP12345 and I need to split it into two new attributes, one with the characters and one the integers (and retain the exising one). Any useful hints are greatly apreciated!

3 replies

takashi
Influencer
  • May 24, 2013
Hi Nic,   The StringSeacher transformer would be the most flexible solution in such a case. An example of regular expression is: ^([A-Z]+)([0-9]+)$   If you are not familiar with the regular expression, see Regular-Expressions.info. Alternatively, if the number of the alphabetical characters is always 2, two SubstringExtractors are also available.

 

 

Takashi  

  • Author
  • May 24, 2013
Thanks Takashi! Substring extractors did the job. Happy boy again!

ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • May 24, 2013
As an alternative if the string is always two digits followed by 5 numbers you can use the Attribute splitter to split at set intervals by using a format string of 2s5s

 

 

Much neater than multiple substring extractors if you want to start splitting a string into more than 2 parts.

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