Skip to main content
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 !
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

Reply