This content has been marked as final. Show 6 replies
You can use Split to separate out the parts of the address. The syntax would be something like this:
addresses = Split([field], " - ")
address = addresses(0)
direction = addresses(1)
I'm not a VB Script or Python person and I'm sure there's some code that would do it easier than my suggestion. There's the Standardize Addresses that breaks up your addresses into multiple fields. From there you can create a new address field and concatenate the address fields you wish to keep into one field and delete the rest.
Attached is an example on how to do this using the field calculator. Make sure that 'Python' is checked at the top. In the example, the values exists in a field called 'FullAddr', and I'm calculating the value to the left of the hypen to a field called 'Address'. You can do the same for the text to the right of the hypen. You will just need to change  to .
You can extract just the address portion of your string with the Python statement:
address=input[:input.find("-")].strip()where input is your original string with both address and direction.
Thanks to everyone for the suggestions! I actually found an existing thread (eventually!!) that allowed me to do what I needed. Using a combination of the Left and InStr functions as found in this post, http://forums.arcgis.com/threads/28351-VBScript-Left()-amp-InStr()-functions-ArcView-10, I was able to get what I needed!
I lifted this from elsewhere but very useful.
this is VB , not python
split on character - To split a field into a list
---------- In code Block ----------
dim splitList dim value splitList= split( [Feild1], ";") if ubound(splitList) > 1 then 'if there's no comma, there's only one value in the splitList array and the next statement would error out value = splitList(0) end if
---------- In Field = ----------