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


I

Best answer by ebygomm

myoungy wrote:

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

View original
Did this help you find an answer to your question?

6 replies

ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • 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
  • 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+49
myoungy wrote:

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+32
  • Influencer
  • Best Answer
  • February 1, 2021
myoungy wrote:

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
  • 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+32
  • Influencer
  • February 1, 2021
myoungy wrote:

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


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