Hello!
I need some assistance with how to edit a few attributes. I did a calculate field process that worked, but it duplicated some of my values in the process. I am editing some data in relation to streets and street types, so some of my values now have duplicated street type information. What are a few ways I can go about editing this? I am working on this through ArcGIS Pro.
Thanks!
Looks like your field calculator was something like NAME + " " + TYPE? You'll notice that 905th Park Rd for example already has Rd in the NAME field, so when you tacked on TYPE, you got two "Rd"s. Depending on how big your dataset is, you might want to sort through and remove those. You could do a Select By Attribute NAME LIKE '%RD' which will highlight all instances where there is text where the last two characters are RD. Then just change for all your different street types.
If you did NAME + " " + TYPE to calculate the RoadName field, you need to clean up your NAME field first. I'd recommend using the arcade Replace function or the .replace python method. You could replace " RD", " AVE", " TRAIL", " CIR", etc. with "", to remove all the types from the name field.. since the type is already in the type field. Making sure to include the space before the road type.
Then you can do NAME + " " + TYPE
Thank you!! Would I utilize this with an if/else statement? How would the formatting look for a replace function?
When removing/replacing the duplicate values in the NAME field, how would I format a script that would obtain this objective? I'm still very new to Python, and the help pages I've looked at so far have directed me to utilize a Reclassification to change those values. Is this the correct method to utilize? I've used the .replace() to initially change values such as 'Block' to 'BL,' so I would assume I would have to use that function to some degree to replace 'DR' to ' ' as an example.
You could use an Arcade replace function.
// Set up the street name
var n = NAME
// Search NAME for the string ' St' and replace with no characters. Repeat for other street types.
var r = replace(NAME,' St','')
return r