Skip to main content
Question

Character on chain

  • July 2, 2013
  • 4 replies
  • 61 views

Hi all,

 

 

I have a string like 400*856  The dimensions of a square.

 

I'm trying to separate both to get the with and hight.

 

 

I tried wit the "string searcher" but I'm not sure what i have to put to get the position of the "*"

 

Then use the substringextractor to make both atributtes.

 

 

Please Could anyone give me a clue?

 

 

Thanks you so much

 

Javier

 

 

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.

4 replies

david_r
Celebrity
  • July 2, 2013
Hi,

 

 

here is one possibility: use a StringSearcher with the regular expression

 

 

(\\d+)\\D(\\d+)

 

 

it will separate the two numbers into _matched_parts{0} and _matched_parts{1}

 

 

David

  • Author
  • July 2, 2013
David,

 

 

It didn't worked, but you gave me the hint.

 

 

I tried with

 

 

([0-9]*)[*]([0-9]*)

 

 

And worked. :)

 

 

I'm not used to these expresions.

 

 

Thanks you so much

 

 

Javier

 

 


takashi
Celebrity
  • July 3, 2013
Hi Javier,   The syntax of the regular expression "(\\d+)\\D(\\d+)" is correct, and the StringSearcher with this expression worked in my environment (FME 2013 SP2). You can learn more about regular expressions here. Another way: the AttributeSplitter (specify * as delimiter) could be a solution. For your Information.   Takashi

  • Author
  • August 3, 2013
Hi Takashi   Thanks you so much for the link.   I can't use the atributteSpliter because the delimiter is not just "*"   Now I have values like   0.7 x 0.8 12 X 0.9   ( I hate them for not to use always the same format)     so I'm trying something like   ([0-9]*\\.[0-9]+|[0-9]+)[*x*|*X*]([0-9]*\\.[0-9]+|[0-9]+)   but when I accept an reopen the transformer the \\ disappears   ([0-9]*.[0-9]+|[0-9]+)[*x*|*X*]([0-9]*.[0-9]+|[0-9]+)

 

 

Any hint?

 

 

Thanks youSubmit