# Fixing attributes...from St to Street

2304
7
01-04-2016 01:10 PM
New Contributor III

Hi,

I am trying to fix my attribute records in Arcmap.

Is there a way to do a bulk fixing, to find all my St and change it to Street?

Tags (2)
1 Solution

Accepted Solutions
MVP Alum

Here's a simple Python field calculator example:

!fieldnamehere!.replace(' ST', ' STREET')

```def StreetSuffix(FacilityAddress):
for item in range(len(list)):
if list[item] == 'STREET':
list[item] = list[item].replace("STREET", "ST")
if list[item] == 'STREET,':
list[item] = list[item].replace("STREET,", "ST")
if list[item] == 'STR.':
list[item] = list[item].replace("STR.", "ST")
if list[item] == 'STR,':
list[item] = list[item].replace("STR,", "ST")
if list[item] == 'ST.':
list[item] = list[item].replace("ST.", "ST")
if list[item] == 'ST,':
list[item] = list[item].replace("ST,", "ST")
if list[item] == 'WAY':
list[item] = list[item].replace("WAY", "WY")
if list[item] == 'WAY,':
list[item] = list[item].replace("WAY,", "WY")
if list[item] == 'WY.':
list[item] = list[item].replace("WY.", "WY")
if list[item] == 'WY,':
list[item] = list[item].replace("WY,", "WY")
return " ".join(list) ```

Credit to Darren Wiens and several others knowledgeable in Python for coming up with this, which I gratefully stole borrowed.

Chris Donohue, GISP

7 Replies
MVP Honored Contributor

There is Find and Replace in Table options.

New Contributor III

Thanks Darren!

MVP Alum

Yes, this can be done in Python.  The Python code can be placed in the field calculator, or a pure Python run can be done.

Chris Donohue, GISP

MVP Emeritus

Or select thuroghfare trailingtype = 'ST' and then calc thuroghfare trainingtype = "STREET"

That should just about do it....
MVP Alum

Here's a simple Python field calculator example:

!fieldnamehere!.replace(' ST', ' STREET')

```def StreetSuffix(FacilityAddress):
for item in range(len(list)):
if list[item] == 'STREET':
list[item] = list[item].replace("STREET", "ST")
if list[item] == 'STREET,':
list[item] = list[item].replace("STREET,", "ST")
if list[item] == 'STR.':
list[item] = list[item].replace("STR.", "ST")
if list[item] == 'STR,':
list[item] = list[item].replace("STR,", "ST")
if list[item] == 'ST.':
list[item] = list[item].replace("ST.", "ST")
if list[item] == 'ST,':
list[item] = list[item].replace("ST,", "ST")
if list[item] == 'WAY':
list[item] = list[item].replace("WAY", "WY")
if list[item] == 'WAY,':
list[item] = list[item].replace("WAY,", "WY")
if list[item] == 'WY.':
list[item] = list[item].replace("WY.", "WY")
if list[item] == 'WY,':
list[item] = list[item].replace("WY,", "WY")
return " ".join(list) ```

Credit to Darren Wiens and several others knowledgeable in Python for coming up with this, which I gratefully stole borrowed.

Chris Donohue, GISP

New Contributor III

Got it fixed. Saved me tons of hours.

MVP Honored Contributor

Now that I see this again, a more compact alternative may be (only lightly tested):

```