How to separate State & Zip from City?

Hello,

I have a file that exports about 76 columns. Some of the columns have information formatted in the same column, but I’d like to maintain the information before sending it to Airtable.

As you can see below, in a single column the addresses include the City, State ZIP together, and sometimes include the extra 4 digits of the ZIP.

So I would like to add on the following columns so it shows separately and not including the 4 digits

  • Los Angeles
  • CA
  • 90048

How would i do this?

Hey @SoCalDude :wave:

We can definitely do this in Parabola. The main parts to consider are the spaces and commas after the city names. Here’s how you can set this up:

Start by importing your source data. Use a “Split column” step to target your Owner City State Zip column. You can split on a comma-space , . Your cities should now be separated.

Your state and zip data should be in a column called Owner City State Zip (1). Use another “Split column” step to target that column and split on every space. Your states and zips should now be separated too.

To remove the last 4 digits in your zip code, add a “Use regex” step to target your Owner City State Zip (2) column. Use the expression -\d* to find the last 4 digits and replace them with a blank value.

Lastly, the “Rename columns” and the “Select columns” steps are used to clean up the data.

Copy and paste this snippet anywhere into your flow to duplicate the step settings used above:

parabola:cb:88962015d1ba4f5d8ae0ecb9ec4c38be

2 Likes

Thank you, I will try this @daniel !

Regarding the regex, will this remove the last 4 digits on a 5 digit zip? If you notice, some of the ZIPs are 5 digits while others are 9 digits

No problem, @SoCalDude

That regex expression will remove any digits in your zip after the dash. So if it’s a 9-digit zip, it will remove those digits. If it’s a 5 digit zip, no digits will be removed.

1 Like