Skip to main content
Solved

Extracting first characters before '/' in attribute

  • December 19, 2013
  • 3 replies
  • 1084 views

lorinda
Contributor
Forum|alt.badge.img+6
Hi All,

 

I'm banging my head on this one.  Should be rather simple, but I'm not getting it.  Think it involves TCL (very rusty on) or at least some splitters and such.

 

 

I've got a zoning table that has one attribute that has the zoning along with all of the overlays that are associated.  I'd like to extract the first portion of the complete zoning that is before the '/' that then lists the overlay - there could be several of these.  I.E.  the complete zoning is:  R-3B/T/SP/PH ; the base zoning is:  R-3B.  Can't use specific numbers to trim as some are:  P/T and I want only the P.  Have got the attribute splitter set up, but having issues with assigning the first in the list to the new attribute.

 

 

Thanks for any help you can offer.

Best answer by fmelizard

Hi,

 

after splitting the attribute value with the / as separator, use an attribute creator ( attribute name: myattnme and attribute value: mylist{0} ) the {0} element is always the fist element of the list. As with all things FME there are several ways to copy the value into a new attribute.

 

Hope this helps,

 

Itay
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

fmelizard
Safer
Forum|alt.badge.img+21
  • Safer
  • Best Answer
  • December 19, 2013
Hi,

 

after splitting the attribute value with the / as separator, use an attribute creator ( attribute name: myattnme and attribute value: mylist{0} ) the {0} element is always the fist element of the list. As with all things FME there are several ways to copy the value into a new attribute.

 

Hope this helps,

 

Itay

lorinda
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • December 19, 2013
Ugh, I knew it was easy.  I was just plugging in the attribute values backwards!  That's what you get for trying to do this stuff with a bad headache.

 

Thanks for pointing me in the right direction.

takashi
Celebrity
  • December 20, 2013
Hi,

 

 

Yes, there are several ways. To split the full zoning into just two parts (base zoning and other), the StringSearcher can be used. If you need only the base zoning, the StringReplacer (use regular expression) would be also available. There could be other ways.

 

 

For your information.

 

Takashi