<?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: Truncate Address in String Field in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/truncate-address-in-string-field/m-p/617873#M34895</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If every record has the city code after the address separated by a dash, this can be done very easily with the field calculator.&amp;nbsp; Set the parser to Python and put in this expression:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
!field_name!.split("-")[0]
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This will return everything before the dash, in your case "123 Main St"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 02:24:00 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-12-12T02:24:00Z</dc:date>
    <item>
      <title>Truncate Address in String Field</title>
      <link>https://community.esri.com/t5/data-management-questions/truncate-address-in-string-field/m-p/617872#M34894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would like to remove city codes from the end of addresses that need to be geocoded and was wondering if there's a simple field calc formula to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example looking to take 123 Main St-AABB and calculate 123 Main St into a new field removing the city code AABB.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have over a thousand addresses so going through deleting by hand is not an option.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2012 13:30:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/truncate-address-in-string-field/m-p/617872#M34894</guid>
      <dc:creator>StevenSmith1</dc:creator>
      <dc:date>2012-10-24T13:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Truncate Address in String Field</title>
      <link>https://community.esri.com/t5/data-management-questions/truncate-address-in-string-field/m-p/617873#M34895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If every record has the city code after the address separated by a dash, this can be done very easily with the field calculator.&amp;nbsp; Set the parser to Python and put in this expression:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
!field_name!.split("-")[0]
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This will return everything before the dash, in your case "123 Main St"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:24:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/truncate-address-in-string-field/m-p/617873#M34895</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T02:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Truncate Address in String Field</title>
      <link>https://community.esri.com/t5/data-management-questions/truncate-address-in-string-field/m-p/617874#M34896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was trying that but without the [0] at the end and it wasn't working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did end of getting the same result from using a combination of the InStr() to find location of "-" then Left ([fieldname], [InStr] -1) but this is one less step and faster.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you again for all your help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2012 14:29:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/truncate-address-in-string-field/m-p/617874#M34896</guid>
      <dc:creator>StevenSmith1</dc:creator>
      <dc:date>2012-10-24T14:29:40Z</dc:date>
    </item>
  </channel>
</rss>

