Skip to main content
Solved

Question about StringReplacer


plynn
Contributor
Forum|alt.badge.img+10
  • Contributor

I am needing to read a comments field and replace the double quotes with 'inches' and replace & with 'and'. I tried my hand with regular expressions, but am very new to this and it did not work (user error I am sure). I also just tried Replace Text and it doesn't seem to work either.

Best answer by geomancer

StringReplacer works all right for me, see the attached workspace (FME 2020.1). It replaces " with <space>inches, and & with and.

I've also tried StringPairReplacer, in this transformer some special characters (like " and space) need to be escaped with \\.

StringReplacer_inch_ampersant

View original
Did this help you find an answer to your question?
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.

2 replies

geomancer
Evangelist
Forum|alt.badge.img+58
  • Evangelist
  • Best Answer
  • August 5, 2021

StringReplacer works all right for me, see the attached workspace (FME 2020.1). It replaces " with <space>inches, and & with and.

I've also tried StringPairReplacer, in this transformer some special characters (like " and space) need to be escaped with \\.

StringReplacer_inch_ampersant


plynn
Contributor
Forum|alt.badge.img+10
  • Author
  • Contributor
  • August 5, 2021
geomancer wrote:

StringReplacer works all right for me, see the attached workspace (FME 2020.1). It replaces " with <space>inches, and & with and.

I've also tried StringPairReplacer, in this transformer some special characters (like " and space) need to be escaped with \\.

StringReplacer_inch_ampersant

Excellent. Thank you!


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