I have an address point feature class. I want to extract only the address suffixes in the Address Field into a new field named Suffix. What is the best approach to do this? (I am new to ArcPy, if someone has the code, would you mind posting it? or if there is a better way than using ArcPy?)
Example: 123 Main St
I want St to be placed in a new Suffix field.
There are 5,000 addresses in the feature class.
Solved! Go to Solution.
python parser, replace fld with !TheNameOfYourField! with the ! marks
fld = "123 Main St"
fld.split(" ")[-1]
Dan's code will work on all of the examples you provided.
python parser, replace fld with !TheNameOfYourField! with the ! marks
fld = "123 Main St"
fld.split(" ")[-1]
That is partially helpful. But the addresses also include suffixes such as:
123 Main St
4561 Buck Ave
90312 Goode Blvd
Any thoughts on how best to handle 3 and 4 letter prefixes?
Would this work for the 2, 3, and 4 letter suffixes?
fld = "123 Main St"
fld.split(" ")[-4]
Dan's code will work on all of the examples you provided.