I need some help with a field calculator expression, using python or arcade, in ArcGIS Pro
I have an address field that has full address, with street number and name, I want to remove the number and retain only the street name, since the number of digits in the address could vary so I want to remove everything that comes before the space, so first word or an element. I am trying to do this using field calculator in ArcGIS Pro, so either Python 3 or Arcade.
For example :
3405 S 51st St
would result in
S 51st St
I tried this
!ADDRESS!.split(" ")[1:] , it did not work.
I looked at this https://community.esri.com/thread/233144-remove-text-in-parenthesis-with-arcade,
but couldn't figure out how to do this with arcade.
If I can get some help with correct syntax for python or an arcade expression would be great.
Thanks
Solved! Go to Solution.
Using Python !ADDRESS!.split(" ", 1)[1] should work for you assuming there are no leading spaces before the address number and addresses do not contain any unit numbers such as "123 C Main Street". You can add a strip() statement to remove leading and trailing spaces such as !ADDRESS!.strip().split(" ", 1)[1].
Using Python !ADDRESS!.split(" ", 1)[1] should work for you assuming there are no leading spaces before the address number and addresses do not contain any unit numbers such as "123 C Main Street". You can add a strip() statement to remove leading and trailing spaces such as !ADDRESS!.strip().split(" ", 1)[1].
Using Arcade you could so something like this:
var firstSpace = find(' ',$feature.ADDRESS,0)
var strCount = count($feature.ADDRESS)
var strDiff = strCount - firstSpace
return right($feature.ADDRESS, strDiff)
Thanks, Mark. This worked too.
Wow, both the options worked, perfectly, Thanks