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 School
You 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
RijiyarGanjiIslamiyyaPrimarySchool
But 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 School
Your 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.
Reply
Rich Text Editor, editor1
Editor toolbars
Press ALT 0 for help
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.