Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Removing FM or AM from end of string only

GoldenDesign04
8 - Asteroid

I have URLs for radio stations and I am attempting to make them phonetically readable for end users.

 

I've created a reference list of about 300 words to find and replace with white space in between and it has been quite successful. But I'm looking to take it a bit further.

 

How would I structure a regex or replace formula to look for fm or am on the end of the string?

 

That way "amarillofm" becomes "amarillo fm"

and not "am arillo fm"

 

basically looking at the end of each string piece to see if there is "am" or "fm" and replacing it with " fm "  or " am "

1 REPLY 1
echuong1
Alteryx Alumni (Retired)

There are a couple of ways to do this, but I think the easiest is with a Formula tool. I basically checked to see if the last 2 characters are FM. If they are, I added " fm." Otherwise, it would be " am."

 

Another option is to simply use left and right functions with concatenation. 

 

echuong1_1-1613602449174.png

 

 

Labels