<?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 Identify Next Number in Sequence  in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/identify-next-number-in-sequence/m-p/469188#M36620</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a series of different Feature Classes and most of them I have assigned a Company Tag/Number and they are in sequential order. What I would like to do is to write a Python script to identify what the next number would be on a given Feature Class's field. If the last sequential number of 2345, I would want the script to "print" 2346. Need to know how to get started.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Want to write a Python script to achieve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Aug 2020 19:30:16 GMT</pubDate>
    <dc:creator>ModernElectric</dc:creator>
    <dc:date>2020-08-05T19:30:16Z</dc:date>
    <item>
      <title>Identify Next Number in Sequence</title>
      <link>https://community.esri.com/t5/python-questions/identify-next-number-in-sequence/m-p/469188#M36620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a series of different Feature Classes and most of them I have assigned a Company Tag/Number and they are in sequential order. What I would like to do is to write a Python script to identify what the next number would be on a given Feature Class's field. If the last sequential number of 2345, I would want the script to "print" 2346. Need to know how to get started.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Want to write a Python script to achieve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2020 19:30:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/identify-next-number-in-sequence/m-p/469188#M36620</guid>
      <dc:creator>ModernElectric</dc:creator>
      <dc:date>2020-08-05T19:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Identify Next Number in Sequence</title>
      <link>https://community.esri.com/t5/python-questions/identify-next-number-in-sequence/m-p/469189#M36621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps something like this would give you an idea.&amp;nbsp; It is using the OBJECTID; just substitute your tag number field in lines 1 and 2:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;value = arcpy.da.SearchCursor(feature, ["OBJECTID"],
                              sql_clause = (None, 'ORDER BY OBJECTID DESC')
                              ).next()[0]

print value
# 19

print value + 1
# 20‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If the tag numbers are spread across several features - that is number 1, 3, 4, etc. can be in one feature, and 2, 5 are in another - you may need to use a table or text file to store the last number used.&amp;nbsp; Then read that table/file, issue tag numbers, then update the table/file with the last used number.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:47:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/identify-next-number-in-sequence/m-p/469189#M36621</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-11T20:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Identify Next Number in Sequence</title>
      <link>https://community.esri.com/t5/python-questions/identify-next-number-in-sequence/m-p/469190#M36622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You Randy. That is what I was looking for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2020 21:07:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/identify-next-number-in-sequence/m-p/469190#M36622</guid>
      <dc:creator>ModernElectric</dc:creator>
      <dc:date>2020-08-05T21:07:40Z</dc:date>
    </item>
  </channel>
</rss>

