Select to view content in your preferred language

Editing Attribute Values

662
4
Jump to solution
10-12-2022 04:07 AM
Labels (1)
JD1016
by
Frequent Contributor

Hello,

I have a parcel attribute table with a field containing addresses.  In several instances, it appears the street type designation has been left off.  For instance, "101 N Maple" should actually be "101 N Maple Avenue".

Is there a way, without having to go through each record in the attribute table, to add the word "Avenue" every time there is a "N Maple" occurrence?

Thank you in advance!

Jeff

0 Kudos
2 Solutions

Accepted Solutions
Kara_Shindle
Frequent Contributor

I can think of a Python way and a non-Python way.  Let's start with the non-Python one.

 

I would select by attribute all records that have "101 N Maple" in them.  Then, change your attribute view to only the selected features, and do a Field Calculator session on only your selected values.

 

In field calculator, you can calculate a field using it's existing values.  So if your field name is something like 

 

 

!Street!

 

 

Then your expression will be something like

 

 

!Street! + ' Avenue'

 

 

Notice I added a space before avenue in the string you are adding on, but that is dependent on if you have a space already in there or not.

Make sure you chose the Python and doublecheck your edits before you save everything to make sure it worked.

View solution in original post

Kara_Shindle
Frequent Contributor

Yes, I would use your wildcard character and the LIKE operator to build a SQL Query.  In ArcMap, that is the percent sign or %

Here's an article to get you started. https://desktop.arcgis.com/en/arcmap/latest/map/working-with-layers/building-a-query-expression.htm#...

 

I'm searching for all rows that in my street address field that have the word Church in them.  I put the wildcard before AND after church, because I know it has street numbers and road types on either side of the road name I'm looking for.

SITUSAddress1 LIKE '%CHURCH%'

 

View solution in original post

4 Replies
Kara_Shindle
Frequent Contributor

I can think of a Python way and a non-Python way.  Let's start with the non-Python one.

 

I would select by attribute all records that have "101 N Maple" in them.  Then, change your attribute view to only the selected features, and do a Field Calculator session on only your selected values.

 

In field calculator, you can calculate a field using it's existing values.  So if your field name is something like 

 

 

!Street!

 

 

Then your expression will be something like

 

 

!Street! + ' Avenue'

 

 

Notice I added a space before avenue in the string you are adding on, but that is dependent on if you have a space already in there or not.

Make sure you chose the Python and doublecheck your edits before you save everything to make sure it worked.

JD1016
by
Frequent Contributor

Hi Kara,

Your code suggestion worked perfectly!

As a follow-up, is there a way to select all instances of the words "N Maple"?  Otherwise, I will have to manually select 101 N Maple, 102 N Maple, 103 N Maple,...you get the idea.

Thanks.

Jeff

0 Kudos
Kara_Shindle
Frequent Contributor

Yes, I would use your wildcard character and the LIKE operator to build a SQL Query.  In ArcMap, that is the percent sign or %

Here's an article to get you started. https://desktop.arcgis.com/en/arcmap/latest/map/working-with-layers/building-a-query-expression.htm#...

 

I'm searching for all rows that in my street address field that have the word Church in them.  I put the wildcard before AND after church, because I know it has street numbers and road types on either side of the road name I'm looking for.

SITUSAddress1 LIKE '%CHURCH%'

 

JD1016
by
Frequent Contributor

PERFECT!

I had employed the use of the LIKE operator with the percent sign before but I had the percent "only" at the end of the code and therefore it would look for those beginning with that instead of ending.  In adding the other %, everything was selected regardless of position.

Thank you, Kara!