Skip to main content
Solved

Extracting first characters before '/' in attribute

  • December 19, 2013
  • 3 replies
  • 686 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
View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, 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
Contributor
Forum|alt.badge.img+17
  • Contributor
  • 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
Contributor
Forum|alt.badge.img+19
  • Contributor
  • 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

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