I have a data that contains whitespaces at the beginning, between and at the end. I have used an attributetrimmer to trim out the spaces at the beginning and end, but I am left with the spaces in between. Please, does anyone have an idea of how I can go about it because I can't keep using a stringreplacer repeatedly for this large dataset?
Solved
Is there any transformer in FME that removes whitespace in between strings all at once apart from using a stringreplacer or attributetrimmer multiple times?
Best answer by geomancer
Your data contains strings like
Rijiyar Ganji Islamiyya Primary SchoolYou ask for any transformer in FME that removes whitespace in between strings all at once.
A single StringReplacer set to replace <space> with nothing, like @david_r and @Hans van der Maarel suggest, does remove all spaces, just like you ask, and gives
RijiyarGanjiIslamiyyaPrimarySchoolBut probably you want to retain one space between words. This can also be accomplished with a single String Replacer, but in 'Replace Regular Expression' mode.
Text to Replace: [ ]{2,} (this means 2 or more consecutive spaces)
Replacement Text: (put a single space here)This results in
Rijiyar Ganji Islamiyya Primary SchoolYour sample data contains no spaces at the beginning or at the end, but you can use an AttributeTrimmer or the Trim-function in an AttributeManager to remove those spaces.
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.
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.



