Skip to main content
Question

Flag the White Spaces

  • February 17, 2014
  • 1 reply
  • 7 views

Forum|alt.badge.img
I have an attribute "Address" from which I want to flag (and not trim) the left and right (Leading & Trailing) white spaces.

 

 

What I want exactly is, a new field is created automatically and if there are any leading and trailing white spaces in the attribute, just put 0s and 1s in that newly created field. Can we do that in FME?

 

 

Thank you in advance !
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.

1 reply

takashi
Celebrity
  • 7843 replies
  • February 17, 2014
Hi,

 

 

I would use an AttributeCreater with a Conditional Value setting.

 

-----

 

Flag =

 

If @Value(Address) Begins With <space> AND @Value(Address) Ends With <space> Then <flag for both>

 

Else If @Value(Address) Begins With <space> Then <flag for left>

 

Else If @Value(Address) Ends With <space> Then <flag for right>

 

Else <flag for no spaces>

 

-----

 

Replace <space> with a real white space when setting.

 

"Matches Regex" operator and appropriate regular expressions can be also used.

 

 

Takashi