Skip to main content
Solved

How to replace spaces with commas?

  • March 26, 2021
  • 6 replies
  • 343 views

I have tried using string replacer to remove the blank spaces with commas but it doesn't seem to work? Screenshot 2021-03-26 at 11.58.54 

I am hoping to get this attribute looking like the below? Any help on how to get here is appreciated.Screenshot 2021-03-25 at 09.51.35

Best answer by inge

If you use an AttributeSplitter with the comma as a delimiter character, it should work. This Transformer would allow you to drop empty parts. That would eliminate the multiple comma issue.

FYI, he AttributeSplitter has a list as output. Hope this helps!

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.

6 replies

redgeographics
Celebrity
Forum|alt.badge.img+62

How do you have your StringReplacer set up? Can you post a screenshot of the parameters?


In the text to replace window I did: (*space*)- will this work?Screenshot 2021-03-26 at 12.14.46


redgeographics
Celebrity
Forum|alt.badge.img+62

In the text to replace window I did: (*space*)- will this work?Screenshot 2021-03-26 at 12.14.46

No, that will look for the combination ( ), which doesn't occur in your text. Simply putting just a space there should do the trick.


No, that will look for the combination ( ), which doesn't occur in your text. Simply putting just a space there should do the trick.

Great that worked but now i seem to have some with multiple commas? Screenshot 2021-03-26 at 12.19.21 


is there a transformer that is best to use to now get those values into separate columns?


inge
Contributor
Forum|alt.badge.img+3
  • Contributor
  • Best Answer
  • March 26, 2021

If you use an AttributeSplitter with the comma as a delimiter character, it should work. This Transformer would allow you to drop empty parts. That would eliminate the multiple comma issue.

FYI, he AttributeSplitter has a list as output. Hope this helps!