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

Alteryx Designer Desktop Discussions

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

Parsing Out City Name

lbolin
8 - Asteroid

I am needing to parse out the City name. The City name is at the end of the string. I am having trouble parsing when the name is 2 and 3 digit name. 

5 REPLIES 5
Qiu
21 - Polaris
21 - Polaris

@lbolin 
Parsing City Name is always tricky.
Maybe you want to use my reply below.

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/How-to-parse-data-using-RegEx-with-my-...

0217-lbolin.PNG

Raj
16 - Nebula

you can use formula tool as well to get the last word

Getword([Field],(Countwords([Field]))-1)

 

gaoa
11 - Bolide

Hi @lbolin 

Is it possible to add a comma delimiter around city names or export one-word vs. two-word city names separately?

Below RegEx expression works for city names with one word.

gaoa_0-1676608485018.png

lbolin
8 - Asteroid

This solution catches the first word it comes to in the list. It doesn't account for city names in the address.

 

example:

1274 Claremont Ave Ashland     output: Claremont

Qiu
21 - Polaris
21 - Polaris

@lbolin 
Cases like these, I dont really think there is a better solution.😐

Labels
Top Solution Authors