<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Trim strings at specific point using Field Calculator in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252136#M14353</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is the variability in contents.&amp;nbsp; Even if you pop() the last two elements (Zip and State) you are still left with a variable length list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might want to try filtering the data through a query or queries.&amp;nbsp; One such query might be&lt;/P&gt;&lt;P&gt;[ADDRESS_FIELD] not like 'PO BOX %'.&amp;nbsp; Maybe look for street types as well.&amp;nbsp; These might give you an idea of what you need to do to tease out&amp;nbsp; the data you're after.&amp;nbsp; You need to get acquainted with the data to be able to do such filtering.&amp;nbsp; After all that you'll still have a ton of error trapping the figure out.&amp;nbsp; Sorry, not a lot of help...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Dec 2014 20:01:34 GMT</pubDate>
    <dc:creator>JoeBorgione</dc:creator>
    <dc:date>2014-12-10T20:01:34Z</dc:date>
    <item>
      <title>Trim strings at specific point using Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252132#M14349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a feature class which contains 40,000 mailing addresses. Each address contains the street address, city, state and zipcode separated by spaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example 1: 123 Northwest Johnson St Cleveland Ohio 12345&lt;/P&gt;&lt;P&gt;Example 2: PO Box 3 Pine Springs Ohio 12345&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to pull out just the street addresses. How do I say: trim off the string starting at the 3rd or 4th to last space? Thanks. Any help would be appreciated. I'm trying combinations of split, trim, etc. but can't get it right.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Dec 2014 19:08:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252132#M14349</guid>
      <dc:creator>DerrickFrese2</dc:creator>
      <dc:date>2014-12-09T19:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Trim strings at specific point using Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252133#M14350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below an example of getting the address without the part from the last space (using the Python parser):&lt;/P&gt;&lt;P&gt;&lt;IMG alt="FieldCalc.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/38808_FieldCalc.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Formula (with "Address" being the name of the field that contains the address string):&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14181661407237512 jive_text_macro" jivemacro_uid="_14181661407237512"&gt;&lt;P&gt;!Address![:!Address!.rfind(' ')]&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Result.png" class="jive-image image-2" src="https://community.esri.com/legacyfs/online/38809_Result.png" style="width: 620px; height: 184px;" /&gt;&lt;/P&gt;&lt;P&gt;If you can detect the part you want to exclude, it is easy. However if you want to obtain "123 Northwest" or "PO Box 3", there is no easy way to detect the parts you need or those you want to exclude.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Xander&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Dec 2014 23:07:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252133#M14350</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2014-12-09T23:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Trim strings at specific point using Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252134#M14351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you haven't already tried it, you might be able to accomplish part of what you want with VB Script and the Left, Mid, and Right string functions.&amp;nbsp; Whether this will be usable will depend on how your data is arranged; though from what you have depicted in your examples it would at least allow you to strip the zip code off.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check out the ESRI help, VBScript string functions section (part way down the page):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calculate Field Examples&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00170000004s000000" title="http://resources.arcgis.com/en/help/main/10.1/index.html#//00170000004s000000"&gt;ArcGIS Help 10.1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As to culling out the City, that looks a bit trickier, given the variability in name-length of a city and the presence of multiple words for some cities.&amp;nbsp; Off the wall idea - somehow tie in a search to a list of known cities that your data would include to then identify what to remove?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris Donohue, GISP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 19:24:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252134#M14351</guid>
      <dc:creator>ChrisDonohue__GISP</dc:creator>
      <dc:date>2014-12-10T19:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Trim strings at specific point using Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252135#M14352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try This&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mid( [Address],1,13 )&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get 123 Northwest&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 20:00:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252135#M14352</guid>
      <dc:creator>derekthompson1</dc:creator>
      <dc:date>2014-12-10T20:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Trim strings at specific point using Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252136#M14353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is the variability in contents.&amp;nbsp; Even if you pop() the last two elements (Zip and State) you are still left with a variable length list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might want to try filtering the data through a query or queries.&amp;nbsp; One such query might be&lt;/P&gt;&lt;P&gt;[ADDRESS_FIELD] not like 'PO BOX %'.&amp;nbsp; Maybe look for street types as well.&amp;nbsp; These might give you an idea of what you need to do to tease out&amp;nbsp; the data you're after.&amp;nbsp; You need to get acquainted with the data to be able to do such filtering.&amp;nbsp; After all that you'll still have a ton of error trapping the figure out.&amp;nbsp; Sorry, not a lot of help...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 20:01:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252136#M14353</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2014-12-10T20:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: Trim strings at specific point using Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252137#M14354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Xander and Joe are on the right track...&lt;BR /&gt;Examine the address from the perspective of non-standard lengths brought about the uncertain number of spaces separating elements in the address.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; #---------------------------------------------------
&amp;gt;&amp;gt;&amp;gt; # parsing non-standard address...problem examination
&amp;gt;&amp;gt;&amp;gt;
&amp;gt;&amp;gt;&amp;gt; address = "123 Northwest Johnson St Cleveland Ohio 12345"
&amp;gt;&amp;gt;&amp;gt; bits = address.split(" ")&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # split it into its components
&amp;gt;&amp;gt;&amp;gt; bits
['123', 'Northwest', 'Johnson', 'St', 'Cleveland', 'Ohio', '12345']
&amp;gt;&amp;gt;&amp;gt; for fiddly in range(len(bits)):&amp;nbsp;&amp;nbsp;&amp;nbsp; # now lets examine the fiddly bits
... print bits[:-fiddly], "step", fiddly
...
[] step 0
['123', 'Northwest', 'Johnson', 'St', 'Cleveland', 'Ohio'] step 1
['123', 'Northwest', 'Johnson', 'St', 'Cleveland'] step 2
['123', 'Northwest', 'Johnson', 'St'] step 3
['123', 'Northwest', 'Johnson'] step 4
['123', 'Northwest'] step 5
['123'] step 6
&amp;gt;&amp;gt;&amp;gt;
&amp;gt;&amp;gt;&amp;gt; # Now for problem address 2
&amp;gt;&amp;gt;&amp;gt; address = "PO Box 3 Pine Springs Ohio 12345"
&amp;gt;&amp;gt;&amp;gt; bits = address.split(" ")&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # split it into its components
&amp;gt;&amp;gt;&amp;gt; bits
['PO', 'Box', '3', 'Pine', 'Springs', 'Ohio', '12345']
&amp;gt;&amp;gt;&amp;gt; for fiddly in range(len(bits)):&amp;nbsp;&amp;nbsp;&amp;nbsp; # now lets examine the fiddly bits
... print bits[:-fiddly], "step", fiddly
...
[] step 0
['PO', 'Box', '3', 'Pine', 'Springs', 'Ohio'] step 1
['PO', 'Box', '3', 'Pine', 'Springs'] step 2
['PO', 'Box', '3', 'Pine'] step 3
['PO', 'Box', '3'] step 4
['PO', 'Box'] step 5
['PO'] step 6
&amp;gt;&amp;gt;&amp;gt;
&amp;gt;&amp;gt;&amp;gt; # In address 1 it took until step 3 to get rid of everything
&amp;gt;&amp;gt;&amp;gt; # up to the city level.&amp;nbsp; in address 2 this was completed by step 2...
&amp;gt;&amp;gt;&amp;gt; # Conclusion?&amp;nbsp; Unless the address contain the same number of elements
&amp;gt;&amp;gt;&amp;gt; # it is not possible to parse data in one pass
&amp;gt;&amp;gt;&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A good reason to parse during data collection and entry.&lt;/P&gt;&lt;P&gt;Do note... that a screw will be thrown into the works when you start mixing state names which are multipart as well...consider&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;address = "123 Northwest Johnson St South New York New York 12345"&amp;nbsp;&amp;nbsp;&amp;nbsp; # Now What!!!&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:29:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252137#M14354</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T12:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Trim strings at specific point using Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252138#M14355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A different idea - how about this as a possible approach - find an existing dataset of already-parsed addresses that include all the ones you have, then match yours to the parsed ones.&amp;nbsp; Then output the parsed ones and pare down from there.&amp;nbsp; I don't know exactly where you would find the parsed dataset(s), but given the proliferation of address information, geocoding, and the like, I suspect it could be feasible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone chime in on where specific sources of such already-parsed datasets could be found?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, Derek, to help with this - what States are your addresses in?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris Donohue, GISP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Edit:&amp;nbsp; fixed some typos]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 20:55:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252138#M14355</guid>
      <dc:creator>ChrisDonohue__GISP</dc:creator>
      <dc:date>2014-12-10T20:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Trim strings at specific point using Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252139#M14356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cleveland, Ohio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 21:07:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252139#M14356</guid>
      <dc:creator>derekthompson1</dc:creator>
      <dc:date>2014-12-10T21:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Trim strings at specific point using Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252140#M14357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried to geocode a sample?&lt;BR /&gt;Removind Cleveland Ohio ZIP&amp;nbsp; is going to narrow it down but you are still left with the problem of&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'123', 'Northwest', 'Johnson', 'St', .....&amp;nbsp; being 4 positions in the list &lt;/P&gt;&lt;P&gt;'PO', 'Box', '3', 'Pine', 'Springs', ......&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and, this being 5&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 21:31:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252140#M14357</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-12-10T21:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Trim strings at specific point using Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252141#M14358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all the input and help.&amp;nbsp; I was able to use 3 iterations of the !Address![:!Address!.rfind(&lt;SPAN class="string"&gt;' ')]&lt;/SPAN&gt; formula to slice off the zip, state, and city.&amp;nbsp; This left me with just the street address, which is all I needed.&amp;nbsp; The tough part was that there were just spaces separating everything so it took some finagling to get the city's sorted out but I finally got it.&amp;nbsp; Leaving a comma between the address, city, state, and zip would have made it much easier.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 22:00:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252141#M14358</guid>
      <dc:creator>DerrickFrese2</dc:creator>
      <dc:date>2014-12-10T22:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: Trim strings at specific point using Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252142#M14359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dan has a point - maybe try geocoding them.&amp;nbsp; I'm in no ways an expert on Geocoding, but I know there are quite a few geocoding services out there.&amp;nbsp; While you may not necessarily be interested in the coordinate location of your address, the address result may very well be parsed for you as part of the process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's a site I remember people mentioning in a post here on GeoNet several weeks ago.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Texas A&amp;amp;M Geoservices&lt;/P&gt;&lt;P&gt;&lt;A href="http://geoservices.tamu.edu/Services/Geocode/OtherGeocoders/" title="http://geoservices.tamu.edu/Services/Geocode/OtherGeocoders/"&gt;List of Online Geocoding Systems&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There may also be local geocoding services publicly available from government entities in your area.&amp;nbsp; Maybe try the city and county governments of your area of interest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris Donohue, GISP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 22:05:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252142#M14359</guid>
      <dc:creator>ChrisDonohue__GISP</dc:creator>
      <dc:date>2014-12-10T22:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Trim strings at specific point using Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252143#M14360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just saw this post a little late ... but I had to do some cleaning of a text address field from another agency... I ran across a script that would parse many of the US type of addressing using pyparsing&lt;/P&gt;&lt;P&gt;-- I do not know where I got the script or to whom to give credit to but I have adapted the script for use in the field calculator and has proven to be an excellent workhorse for me....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will of course have to adapt it for you own specific use.... the example below parses the streetname from the address..... you can retrieve also the house number, streetnumber, streettype, PO Box etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from pyparsing import *
def ParseAddress(address):
# define number as a set of words
&amp;nbsp;&amp;nbsp;&amp;nbsp; units = oneOf("Zero One Two Three Four Five Six Seven Eight Nine Ten"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Eleven Twelve Thirteen Fourteen Fifteen Sixteen Seventeen Eighteen Nineteen",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; caseless=True)
&amp;nbsp;&amp;nbsp;&amp;nbsp; tens = oneOf("Ten Twenty Thirty Forty Fourty Fifty Sixty Seventy Eighty Ninety",caseless=True)
&amp;nbsp;&amp;nbsp;&amp;nbsp; hundred = CaselessLiteral("Hundred")
&amp;nbsp;&amp;nbsp;&amp;nbsp; thousand = CaselessLiteral("Thousand")
&amp;nbsp;&amp;nbsp;&amp;nbsp; OPT_DASH = Optional("-")
&amp;nbsp;&amp;nbsp;&amp;nbsp; numberword = ((( units + OPT_DASH + Optional(thousand) + OPT_DASH + 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Optional(units + OPT_DASH + hundred) + OPT_DASH + 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Optional(tens)) ^ tens ) 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + OPT_DASH + Optional(units) )


&amp;nbsp;&amp;nbsp;&amp;nbsp; # number can be any of the forms 123, 21B, 222-A or 23 1/2
&amp;nbsp;&amp;nbsp;&amp;nbsp; housenumber = originalTextFor( numberword | Combine(Word(nums) + 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Optional(OPT_DASH + oneOf(list(alphas))+FollowedBy(White()))) + 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Optional(OPT_DASH + "1/2")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )
&amp;nbsp;&amp;nbsp;&amp;nbsp; numberSuffix = oneOf("st th nd rd").setName("numberSuffix")
&amp;nbsp;&amp;nbsp;&amp;nbsp; streetnumber = originalTextFor( Word(nums) + 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Optional(OPT_DASH + "1/2") +
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Optional(numberSuffix) )


&amp;nbsp;&amp;nbsp;&amp;nbsp; # just a basic word of alpha characters, Maple, Main, etc.
&amp;nbsp;&amp;nbsp;&amp;nbsp; name = ~numberSuffix + Word(alphas)


&amp;nbsp;&amp;nbsp;&amp;nbsp; # types of streets - extend as desired
&amp;nbsp;&amp;nbsp;&amp;nbsp; type_ = Combine( MatchFirst(map(Keyword,"ST BLVD LN RD AVE PASS "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "TRL PATH PSGE WAY LANE "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "CIR DR PKWY CT SQ "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "LP TER TERR PL".split())) + Optional(".").suppress())


&amp;nbsp;&amp;nbsp;&amp;nbsp; # street name 
&amp;nbsp;&amp;nbsp;&amp;nbsp; nsew = Combine(oneOf("N S E W North South East West NW NE SW SE") + Optional("."))
&amp;nbsp;&amp;nbsp;&amp;nbsp; streetName = (Combine( Optional(nsew) + streetnumber + 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Optional("1/2") + 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Optional(numberSuffix), joinString=" ", adjacent=False )
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^ Combine(~numberSuffix + OneOrMore(~type_ + Combine(Word(alphas) + Optional("."))), joinString=" ", adjacent=False) 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^ Combine("Avenue" + Word(alphas), joinString=" ", adjacent=False)).setName("streetName")


&amp;nbsp;&amp;nbsp;&amp;nbsp; # PO Box handling
&amp;nbsp;&amp;nbsp;&amp;nbsp; acronym = lambda s : Regex(r"\.?\s*".join(s)+r"\.?")
&amp;nbsp;&amp;nbsp;&amp;nbsp; poBoxRef = ((acronym("PO") | acronym("APO") | acronym("AFP")) + 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Optional(CaselessLiteral("BOX"))) + Word(alphanums)("boxnumber")


&amp;nbsp;&amp;nbsp;&amp;nbsp; # basic street address
&amp;nbsp;&amp;nbsp;&amp;nbsp; streetReference = streetName.setResultsName("name") + Optional(type_).setResultsName("type")
&amp;nbsp;&amp;nbsp;&amp;nbsp; direct = housenumber.setResultsName("number") + streetReference
&amp;nbsp;&amp;nbsp;&amp;nbsp; intersection = ( streetReference.setResultsName("crossStreet") + 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ( '@' | Keyword("and",caseless=True)) +
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; streetReference.setResultsName("street") )
&amp;nbsp;&amp;nbsp;&amp;nbsp; streetAddress = ( poBoxRef("street")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^ direct.setResultsName("street")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^ streetReference.setResultsName("street")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^ intersection )


&amp;nbsp;&amp;nbsp;&amp;nbsp; # how to add Apt, Suite, etc.
&amp;nbsp;&amp;nbsp;&amp;nbsp; suiteRef = (
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oneOf("Suite Ste Apt Apartment Room Rm #", caseless=True) + 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Optional(".") + 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Word(alphanums+'-')("suitenumber"))
&amp;nbsp;&amp;nbsp;&amp;nbsp; streetAddress = streetAddress + Optional(Suppress(',') + suiteRef("suite"))


&amp;nbsp;&amp;nbsp;&amp;nbsp; return streetAddress.parseString(address, parseAll=True)




__esri_field_calculator_splitter__
ParseAddress( !PHY_ADDR1!).street.name&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:29:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/trim-strings-at-specific-point-using-field/m-p/252143#M14360</guid>
      <dc:creator>TedKowal</dc:creator>
      <dc:date>2021-12-11T12:29:50Z</dc:date>
    </item>
  </channel>
</rss>

