Skip to main content
Solved

I am using StringReplacer to remove unwanted words from an excel column. Is it possible to remove more than one word at a time or do you have to add a StringReplacer for every word I need to remove.? Thank you

  • February 1, 2021
  • 6 replies
  • 93 views

I

Best answer by ebygomm

Hi,

I wish to remove certain words from a postal address completely.

Using the StringReplacer I tried using the text editor  like you mentioned in the 'Text To Replace' option to build a SQL style query 

In ArcMap this would be

[Address] = "Value1" or [Address] = "Value2" to select the words to remove

 

in FME text editor I tried the following (and may well have this completely wrong) 

@Value(Address) = "Value1" or @Value="Value2"

But it doesn't seem to be finding the values

I am leaving  the Replacement Text box blank

 

Thanks

Mark

 

 

If you use mode regular expression, you can build a regular expression to match multiple words and replace with nothing, e.g. to replace dog or cat you could use

\bcat\b|\bdog\b

the \b before and after the words indicates a word boundary, this means that you only match instances of cat and dog not catchment or dogwood. The | means or

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

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • February 1, 2021

Are you wanting to replace multiple words with one single word? In which case you can use regex matching to specify multiple words.

 

Or if you have multiple words you want to replace, each replaced with a different value you can look at the StringPairReplacer


  • Author
  • 2 replies
  • February 1, 2021

Hi,

I wish to remove certain words from a postal address completely.

Using the StringReplacer I tried using the text editor like you mentioned in the 'Text To Replace' option to build a SQL style query

In ArcMap this would be

[Address] = "Value1" or [Address] = "Value2" to select the words to remove

 

in FME text editor I tried the following (and may well have this completely wrong)

@Value(Address) = "Value1" or @Value="Value2"

But it doesn't seem to be finding the values

I am leaving the Replacement Text box blank

 

Thanks

Mark

 

 


redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3700 replies
  • February 1, 2021

Hi,

I wish to remove certain words from a postal address completely.

Using the StringReplacer I tried using the text editor like you mentioned in the 'Text To Replace' option to build a SQL style query

In ArcMap this would be

[Address] = "Value1" or [Address] = "Value2" to select the words to remove

 

in FME text editor I tried the following (and may well have this completely wrong)

@Value(Address) = "Value1" or @Value="Value2"

But it doesn't seem to be finding the values

I am leaving the Replacement Text box blank

 

Thanks

Mark

 

 

Try using a Regular Expression: [Value1|Value2] should work. Make sure to set the mode to "Replace Regular Expression" though.


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • Best Answer
  • February 1, 2021

Hi,

I wish to remove certain words from a postal address completely.

Using the StringReplacer I tried using the text editor  like you mentioned in the 'Text To Replace' option to build a SQL style query 

In ArcMap this would be

[Address] = "Value1" or [Address] = "Value2" to select the words to remove

 

in FME text editor I tried the following (and may well have this completely wrong) 

@Value(Address) = "Value1" or @Value="Value2"

But it doesn't seem to be finding the values

I am leaving  the Replacement Text box blank

 

Thanks

Mark

 

 

If you use mode regular expression, you can build a regular expression to match multiple words and replace with nothing, e.g. to replace dog or cat you could use

\bcat\b|\bdog\b

the \b before and after the words indicates a word boundary, this means that you only match instances of cat and dog not catchment or dogwood. The | means or


  • Author
  • 2 replies
  • February 1, 2021

Hello,

Thank you @ebygomm and @redgeographics for your help - that's worked perfectly

I am new to the forums - can I mark this post as answered?

 

Mark


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • February 1, 2021

Hello,

Thank you @ebygomm and @redgeographics for your help - that's worked perfectly

I am new to the forums - can I mark this post as answered?

 

Mark

There should be options at the bottom of each post

 

Upvote * Reply *Select as Best

 

Select as Best will mark the question as answered