Skip to main content

I am looking up posts about extract pattern to find help for my problem. 

 

I’m trying to extract the city name in a field. The field has punctuations and often times has Zip codes and other times the State. Here are some examples of the field. 

 

Denver. 80211

Denver CO CO

Aurora, 

Littleton, CO CO

Denver 80128

Littleton CO. 80411

 

How do i grab the first city only? Im thinking of removing the numbers and punctuations, but don’t know how. Thanks

Hi Jeff,

That could be tricky to do, especially since cities can consist of multiple words and might also include periods. Example: St. Augustine, FL.

Is there any way to clean the data up before it gets into the Zap? How is it getting to Zapier? Is it a form submission, an email parser, etc? Can you elaborate a bit on what the overall process looks like?


Hi @JMoore ,

Circling back to see if you were all set or had additional questions on how to possibly extract the city name from your field. I have also merged your posts so any responses/replies can be documented in one thread :relaxed:

Please let us know if you have any questions- happy to help!


Yes thank you Liz and Nick. I went ahead and figured out how to do some coding and used a “extract pattern” step to extract only words containing letters. Which is what i needed to do. Tested it a few times with different names and its been working. if anyone is interested in that code, i can post it. 


Thanks


@JMoore that’s great! If you’re comfortable sharing the code, I’m sure other users would love to see how you did it.

Thanks for letting us know!!


 


That’s awesome @JMoore! Extract Pattern is super powerful but super easy to get incorrect, since it has to be set up very precisely in order to work. Thanks so much for sharing that :)