Skip to main content
Question

Flag the White Spaces

  • February 17, 2014
  • 1 reply
  • 4 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 !

1 reply

takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • 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

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