<?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: Field Calculate Sequential Numbers starting with specific 18 digit number in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310697#M24170</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;It is a String fieldThe script I found on the field calculator help:Parser:&lt;/P&gt;&lt;P&gt;Python&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;P&gt;autoIncrement()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code Block:&lt;/P&gt;&lt;P&gt;rec=0&lt;/P&gt;&lt;P&gt;def autoIncrement():&lt;/P&gt;&lt;P&gt;    global rec&lt;/P&gt;&lt;P&gt;    pStart = 1 #adjust start value, if req'd &lt;/P&gt;&lt;P&gt;    pInterval = 1 #adjust interval value, if req'd&lt;/P&gt;&lt;P&gt;    if (rec == 0): &lt;/P&gt;&lt;P&gt;        rec = pStart &lt;/P&gt;&lt;P&gt;    else: &lt;/P&gt;&lt;P&gt;        rec = rec + pInterval &lt;/P&gt;&lt;P&gt;    return rec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 May 2016 15:27:49 GMT</pubDate>
    <dc:creator>anayoung</dc:creator>
    <dc:date>2016-05-09T15:27:49Z</dc:date>
    <item>
      <title>Field Calculate Sequential Numbers starting with specific 18 digit number</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310695#M24168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am need to field calculate sequential numbers starting with 033900000100191511. So, the numbering would be 033900000100191511, 033900000100191512, 033900000100191513 etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me with a python script for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With much appreciation,&lt;/P&gt;&lt;P&gt;Ana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2016 14:41:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310695#M24168</guid>
      <dc:creator>anayoung</dc:creator>
      <dc:date>2016-05-09T14:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculate Sequential Numbers starting with specific 18 digit number</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310696#M24169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the field type? &lt;/P&gt;&lt;P&gt;What do you have as a script so far?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2016 15:01:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310696#M24169</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-09T15:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculate Sequential Numbers starting with specific 18 digit number</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310697#M24170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;It is a String fieldThe script I found on the field calculator help:Parser:&lt;/P&gt;&lt;P&gt;Python&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;P&gt;autoIncrement()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code Block:&lt;/P&gt;&lt;P&gt;rec=0&lt;/P&gt;&lt;P&gt;def autoIncrement():&lt;/P&gt;&lt;P&gt;    global rec&lt;/P&gt;&lt;P&gt;    pStart = 1 #adjust start value, if req'd &lt;/P&gt;&lt;P&gt;    pInterval = 1 #adjust interval value, if req'd&lt;/P&gt;&lt;P&gt;    if (rec == 0): &lt;/P&gt;&lt;P&gt;        rec = pStart &lt;/P&gt;&lt;P&gt;    else: &lt;/P&gt;&lt;P&gt;        rec = rec + pInterval &lt;/P&gt;&lt;P&gt;    return rec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2016 15:27:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310697#M24170</guid>
      <dc:creator>anayoung</dc:creator>
      <dc:date>2016-05-09T15:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculate Sequential Numbers starting with specific 18 digit number</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310698#M24171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok... that is an ugly one, since you are working with strings so the simplest thing is to increment from a know easy starting point and concatenate the string to it.&lt;/P&gt;&lt;P&gt;try these fixes&lt;/P&gt;&lt;P&gt;pstart = 511&lt;/P&gt;&lt;P&gt;return "033900000100191" + str(rec)&lt;/P&gt;&lt;P&gt;can't test it, so just select a few rows and try it and report back with a screen grab of the table if possible&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2016 15:47:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310698#M24171</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-09T15:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculate Sequential Numbers starting with specific 18 digit number</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310699#M24172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;I've been trying the code but haven't been successful yet. Either it needs something different or our network problems are interfering with the calculation. I have attached a screen shot showing the field calculator with the adjusted code you provided below:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="SeqNumbering.PNG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/199145_SeqNumbering.PNG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2016 17:55:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310699#M24172</guid>
      <dc:creator>anayoung</dc:creator>
      <dc:date>2016-05-09T17:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculate Sequential Numbers starting with specific 18 digit number</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310700#M24173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dan,I think this expression will calculate wrong number if the records &lt;SPAN style="text-decoration: underline;"&gt;more than 489&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;because it will add a new digit and the total digits for record will be 19 digit , but Ana Young want 18 digit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, you should to know the count of all records that Ana have, to write the expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2016 17:56:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310700#M24173</guid>
      <dc:creator>AbdullahAnter</dc:creator>
      <dc:date>2016-05-09T17:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculate Sequential Numbers starting with specific 18 digit number</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310701#M24174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you need to enable the code block check box and set your python parser to python.&lt;/P&gt;&lt;P&gt;you don't include the Code block line because what follows is the code block&lt;/P&gt;&lt;P&gt;in the Expression box, you put in&amp;nbsp;&amp;nbsp;&amp;nbsp; autoIncrement()&amp;nbsp; which is the name of the script you using&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2016 18:07:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310701#M24174</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-09T18:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculate Sequential Numbers starting with specific 18 digit number</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310702#M24175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PS&lt;/P&gt;&lt;P&gt;check the documentation on using code blocks in the examples section&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/calculate-field-examples.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/calculate-field-examples.htm"&gt;Calculate Field examples—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2016 18:25:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310702#M24175</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-09T18:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculate Sequential Numbers starting with specific 18 digit number</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310703#M24176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using a generator expression and string formatting, the number of records doesn't need to be known ahead of time:&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;next(g)&lt;/PRE&gt;&lt;P&gt;Code Block:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def gen(x):
&amp;nbsp;&amp;nbsp;&amp;nbsp; while True:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yield "{:0=18}".format(x)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x+=1
g = gen(33900000100191511)&amp;nbsp; #or replace with different starting number (not string of number)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:51:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310703#M24176</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-11T14:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculate Sequential Numbers starting with specific 18 digit number</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310704#M24177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. using your expression ,Joshua. let us not need to know number of records.&lt;/P&gt;&lt;P&gt;Good job, Joshua.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2016 19:45:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310704#M24177</guid>
      <dc:creator>AbdullahAnter</dc:creator>
      <dc:date>2016-05-09T19:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculate Sequential Numbers starting with specific 18 digit number</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310705#M24178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ana... for completeness, Joshua is using a generator... you might want to read up on them if you plan to use them in the field calculator a lot&lt;/P&gt;&lt;P&gt;&lt;A href="https://wiki.python.org/moin/Generators" title="https://wiki.python.org/moin/Generators"&gt;https://wiki.python.org/moin/Generators&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2016 19:58:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310705#M24178</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-09T19:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculate Sequential Numbers starting with specific 18 digit number</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310706#M24179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will work on this tomorrow again. Thank you all for your suggestions. I will get back to you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2016 21:43:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310706#M24179</guid>
      <dc:creator>anayoung</dc:creator>
      <dc:date>2016-05-09T21:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculate Sequential Numbers starting with specific 18 digit number</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310707#M24180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abdullah,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you have a point in that I have about 1100 records that need these 18 digit numbers. So, the code would probably need to be alphanumeric after &lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;033900000100191999. So the numbers would go something like - &lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;0339000001001915AA, &lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;0339000001001915AB, &lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;0339000001001915AC, ..., &lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;0339000001001915AZ, &lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;0339000001001915BA...&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;0339000001001915ZZ, &lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;0339000001001916AA..&lt;/SPAN&gt;&lt;/SPAN&gt;etc. until all 1100 records have unique numbers. This set of 1100 isn't the only set I will need to do; I have 21 other sets.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Can the code be adjusted to calculate like this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 13:22:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310707#M24180</guid>
      <dc:creator>anayoung</dc:creator>
      <dc:date>2016-05-10T13:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculate Sequential Numbers starting with specific 18 digit number</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310708#M24181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, just adjust the length of the string and starting value in either my example or Joshua's.&lt;/P&gt;&lt;P&gt;However, now you are introducing unique letter combinations that weren't in the original post.&lt;/P&gt;&lt;P&gt;Perhaps you can elaborate on the significance of the original coding system. &lt;/P&gt;&lt;P&gt;If it has to be maintained, can you explain why, and where the switch to letters is to begin.&lt;/P&gt;&lt;P&gt;If it doesn't have to be maintained, is there a coding system that you wish to employ. &lt;/P&gt;&lt;P&gt;Since you are working with a string encoding system, there are far more unique values that can be generated than I suspect you have data for.&amp;nbsp; Is your record set in the millions? tens of millions?&lt;/P&gt;&lt;P&gt;A background to your current system would be helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 13:29:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310708#M24181</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-10T13:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculate Sequential Numbers starting with specific 18 digit number</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310709#M24182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, I apologize for not thinking it all the way through. I'm kind of new to this kind of thinking. &lt;/P&gt;&lt;P&gt;In my roads feature class there are over 800,000 segments of road polylines. Each of these segments has a road name and a unique road identifier; these roads are either one way or both ways. The case of a one way there is only one identifier e.g. 033900000100191511. If both ways then there are two identifiers - one for each way. The number is broken down as follows from left to right using 033900000100191511 as an example:&lt;/P&gt;&lt;P&gt;1) first three characters are the parish number "033" (East Baton Rouge Parish in Louisiana)&lt;/P&gt;&lt;P&gt;2) the 4th character is the prefix code "9" (this road has no prefix so it is 9)&lt;/P&gt;&lt;P&gt;3) the next 6 characters are a name code "000001" (this is for "UNNAMED" streets)&lt;/P&gt;&lt;P&gt;4) the next 3 are the roadway type "001" (this is a NULL value but it would normally tell you if it was a street, drive, blvd, etc)&lt;/P&gt;&lt;P&gt;5) the next 1 character is the suffix code "9" ( this road has no suffix so it is 9)&lt;/P&gt;&lt;P&gt;6) the next 1 character is feature type code "1" (this tells you that the road is traveling in the primary direction; it would be a 2 if in the secondary)&lt;/P&gt;&lt;P&gt;7) the last 3 characters represent the sequential occurrence of the feature type "511"&lt;/P&gt;&lt;P&gt;The thing I would need to keep in mind before simply calculating is that some of these segments are the same road; so, those will have the same 18 digit number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that since the UNNAMED streets all have the same numbers until they reach the sequential occurrence number at the end (i.e. 033900000100191???) or 033900000100192??? the sequential occurrence numbers need to be unique. The switch to letters needs to begin after the last three numbers reach 999 but in a sequence as mentioned in my previous comment. After 999 it should start 5AA, 5AB -&amp;gt; 5AZ then start with 6AA -6ZZ then after the sequence reaches 9ZZ it should probably go to something like Z01. No duplicates should exist, obviously.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These numbers will remain in the data set until such time they are retired or we find out there's actually a name associated with them. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does this clarify my problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 14:19:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310709#M24182</guid>
      <dc:creator>anayoung</dc:creator>
      <dc:date>2016-05-10T14:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculate Sequential Numbers starting with specific 18 digit number</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310710#M24183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To add to my last comment. the last three numbers just need to be unique so however that is derived it would be fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 14:22:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310710#M24183</guid>
      <dc:creator>anayoung</dc:creator>
      <dc:date>2016-05-10T14:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculate Sequential Numbers starting with specific 18 digit number</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310711#M24184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;beginning to see the pattern, but I just want to make sure that you will be starting at a known position and not from the beginning of the data set, so you will always need a start key, and then you just want to be able to extend up to ...999, then carry on using 5AA...5ZZ, 6AA...6ZZ....9AA..9ZZ which still limits your combinations but is more manageable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 15:25:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310711#M24184</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-10T15:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculate Sequential Numbers starting with specific 18 digit number</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310712#M24185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, each parish in the state will have a different starting number for the sequencing. Because the first three numbers in the 18 digit number defines the parish the road is in, I won't have to worry about duplicate numbers in that regard. I'm assuming the "start key" is the "pStart" in the code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 16:06:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310712#M24185</guid>
      <dc:creator>anayoung</dc:creator>
      <dc:date>2016-05-10T16:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculate Sequential Numbers starting with specific 18 digit number</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310713#M24186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;getting waylaid for a while, but some useful code in case someone else is working on this.&amp;nbsp; It produces the 676 combinations of uppercase&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UC = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")&lt;/P&gt;&lt;P&gt;cr_vals = [c + r for c in UC for r in UC]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 17:04:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310713#M24186</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-10T17:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculate Sequential Numbers starting with specific 18 digit number</title>
      <link>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310714#M24187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This will produce the codes, but it should be in a generator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def base(decimal ,base) : 
&amp;nbsp;&amp;nbsp;&amp;nbsp; list = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 
&amp;nbsp;&amp;nbsp;&amp;nbsp; answer = "" 
&amp;nbsp;&amp;nbsp;&amp;nbsp; while decimal != 0 : 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; answer&amp;nbsp; += list[decimal % base] 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; decimal /= base
&amp;nbsp;&amp;nbsp;&amp;nbsp; return answer[::-1]

# prints 3379 codes - 5AA to 9ZZ
for j in range(5, 10) :
&amp;nbsp;&amp;nbsp;&amp;nbsp; for i in range(0,676) :
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = base(int(i % 676),26)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if len(x) == 0 :
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print str(j) +'AA'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif len(x) == 1 :
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print str(j) +'A' + str(x)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else : print str(j) + str(x)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:51:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculate-sequential-numbers-starting-with/m-p/310714#M24187</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-11T14:51:37Z</dc:date>
    </item>
  </channel>
</rss>

