AnsweredAssumed Answered

Splitting text strings

Question asked by Caleb1987 on Jul 2, 2012
Latest reply on Jul 27, 2012 by Caleb1987
I am working on an addressing project for my county and I am trying to split an address field from parcel data that we have.  I have been using the !Field!.split(" ")[0] function to split them by spaces.  The problem is I want to get street names that have 2 and 3 words to be separate from the N, S, E, and W prefixes and not all of the records in the field have the N or S before the street name so doing it by order of the spaces is not really going to work.  I am wondering if there is any sort of .length() type function to select only one letter parts of a record in a string (the N, S, E, or W) and put it into a field by itself so I know which addresses I need to populate the prefix for?  Or what is the best way to split fields when I have street names like Valley Forge Dr, N Main St, and King Ave?  I need the direction in one field, the street name in another (one and two word street names), and the suffix in the last field. I know to get just the suffix I can use the !Field!.split(" ")[-1], but is it possible to just get the prefix from the records that have one?  If anyone can help please let me know! Thanks!

GIS Technician
Cedar County, IA