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'
Thank You so very much! Now, how do I delete the suffix off the original Mountain View Blvd to generate Mountain View?
I found something along this line that works well,, although I am not very
use to Python... THANKS
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
Thanks that sounds easier (does that work with however many words may be in the field?
ei Mountain View Farms Blvd?)
>>> a = "Do you mean this Mountain View Farms Blvd" >>> " ".join(a.split(" ")[:-1]) 'Do you mean this Mountain View Farms'
yes, I have 1000+ various street name to break up that are all different
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