<?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: Calculate Python Right n characters on variable length attribute in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-python-right-n-characters-on-variable/m-p/1099957#M45769</link>
    <description>&lt;P&gt;Ummm, what's wrong with &lt;STRONG&gt;!APN![5:]&lt;/STRONG&gt; ?&lt;/P&gt;</description>
    <pubDate>Mon, 20 Sep 2021 15:53:35 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2021-09-20T15:53:35Z</dc:date>
    <item>
      <title>Calculate Python Right n characters on variable length attribute</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-python-right-n-characters-on-variable/m-p/1099951#M45768</link>
      <description>&lt;P&gt;Good Morning All,&lt;/P&gt;&lt;P&gt;This is more of an archiving of knowledge and perhaps a help to others but I would certainly like comments if there is a better or way to do what I needed.&lt;/P&gt;&lt;P&gt;I recently needed to pull the remaining characters out of a variable length text attribute after a certain starting point. The&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-field-examples.htm" target="_blank" rel="noopener"&gt;Calculate Field Python examples&lt;/A&gt;&amp;nbsp; was a great starting point with its&amp;nbsp;!SUB_REGION![-3:] for the right most characters but did not fit my situation where the starting attribute contains variable length records.&lt;/P&gt;&lt;P&gt;I needed to grab the remaining characters after character 5. For our Assessor system positions 1-3 = Book, 4-5 = Page, 6-8 or 9 = Parcel depending on if there is an alpha character or not.&lt;/P&gt;&lt;P&gt;APN Sample data:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ThomasHoman_0-1632151901515.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/23392i1FF48E86472DCBDF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ThomasHoman_0-1632151901515.png" alt="ThomasHoman_0-1632151901515.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What I came up with on the Calculate Field is Parcel = &lt;STRONG&gt;!APN![0-len(!APN!)+5:]&lt;/STRONG&gt;&amp;nbsp; This calculates the remaining characters by attribute. By starting with 0 and subtracting the length of the attribute then adding in how many characters to ignore, the remaining characters are copied to the Parcel attribute.&lt;/P&gt;&lt;P&gt;This is what worked for me. In programming there are always alternative methods so please feel free to share.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 15:36:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-python-right-n-characters-on-variable/m-p/1099951#M45768</guid>
      <dc:creator>ThomasHoman</dc:creator>
      <dc:date>2021-09-20T15:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Python Right n characters on variable length attribute</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-python-right-n-characters-on-variable/m-p/1099957#M45769</link>
      <description>&lt;P&gt;Ummm, what's wrong with &lt;STRONG&gt;!APN![5:]&lt;/STRONG&gt; ?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 15:53:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-python-right-n-characters-on-variable/m-p/1099957#M45769</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-09-20T15:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Python Right n characters on variable length attribute</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-python-right-n-characters-on-variable/m-p/1100003#M45775</link>
      <description>&lt;P&gt;Agree with&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 17:21:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-python-right-n-characters-on-variable/m-p/1100003#M45775</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-09-20T17:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Python Right n characters on variable length attribute</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-python-right-n-characters-on-variable/m-p/1103199#M46154</link>
      <description>&lt;P&gt;Thanks Johannes!&lt;/P&gt;&lt;P&gt;My way was because I am not that familiar with the Python language so though I would post my solution knowing there had to be a better way.&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 18:04:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-python-right-n-characters-on-variable/m-p/1103199#M46154</guid>
      <dc:creator>ThomasHoman</dc:creator>
      <dc:date>2021-09-29T18:04:21Z</dc:date>
    </item>
  </channel>
</rss>

