I am working with street names and need only the suffix returned (Dr, Blvd, St, Pkwy)
ei. Mountain View Blvd = Blvd
I attempted to go from the right to left and looking for the first space " " from the right (between View _ Blvd) to split?
in VBA if possible
if it is space delimited, and strip... first and last as examples... time to use python... so set your parser accordingly
>>> a = "Mountain View Blvd" >>> a.split(" ").strip() 'Mountain' >>> a.split(" ")[-1].strip() 'Blvd'
Yes, that is good, but it can be simplified into
>>> " ".join(a.split(" ")[:-1]) 'Mountain View'
by just replacing 'a' with !Your_Field_Name! or whatever your fieldname is, just make sure you surround it with exclamation marks
Not to steal any of dan's thunder, but here is a link to a thread that really helped me out:
The calc script provided there in works wonders for me!
I will definitely be using that in the future! Thanks Joe.
actually for now I just have the street name to split out, maybe I was going about this a bit backwards! LOL