<?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: Trying to iterate through the a Layer and assign a list of Unique ID to a Field from attribute table in ArcMap Questions</title>
    <link>https://community.esri.com/t5/arcmap-questions/trying-to-iterate-through-the-a-layer-and-assign-a/m-p/1327016#M4561</link>
    <description>&lt;P&gt;How/where are you trying to accomplish this?&amp;nbsp; In ArcMap with select and calculate field GP tools, or in a python window?&lt;/P&gt;&lt;P&gt;Also, you say sequential name that 'you have created'.&amp;nbsp; Do you have a separate lookup table or are you wanting it to start with the first FOSC row and append the sequential number to the end of "&lt;SPAN&gt;SPLCNV" for the Station ID field value?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Need some kind of clarification as your examples show different values (other than the sequential number) appended to the end.&amp;nbsp; ( A1A00#, 1B00#,&amp;nbsp;1Z00# ) or are these typos as there doesn't seem to be a pattern other than the last three numbers (where are the A's, B's and Z's coming from).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Sep 2023 21:26:49 GMT</pubDate>
    <dc:creator>RhettZufelt</dc:creator>
    <dc:date>2023-09-08T21:26:49Z</dc:date>
    <item>
      <title>Trying to iterate through the a Layer and assign a list of Unique ID to a Field from attribute table</title>
      <link>https://community.esri.com/t5/arcmap-questions/trying-to-iterate-through-the-a-layer-and-assign-a/m-p/1326974#M4560</link>
      <description>&lt;P&gt;Hello, I'm a beginner in ArcPy and I want to perform some tasks using ArcPy but I am not getting results. Using ArcMap I have an attribute field, with like 13K number of records. The Layer is called Splicepoint.&lt;/P&gt;&lt;P&gt;I would like to change the names of a fields in the attribute table called Station ID (to have a sequential name that I have created. In 11 character long name – SPLCNVA1A001, SPLCNVA1A002, SPLCNVA1A003…… SPLCNV1B001….. SPLCNV1Z001….. SPLCNV1Z999) They are all related to the field of SUBTYPE (FOSC). Also, I need to skip I and O’s to avoid confusion .&lt;/P&gt;&lt;P&gt;This is just a one time code that would keep changing the sequence.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Picture1.png" style="width: 284px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/80244iD8AD9DBB7038CFDB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Picture1.png" alt="Picture1.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Picture2.png" style="width: 281px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/80245i4906729BC72A9D90/image-size/large?v=v2&amp;amp;px=999" role="button" title="Picture2.png" alt="Picture2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 19:43:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/trying-to-iterate-through-the-a-layer-and-assign-a/m-p/1326974#M4560</guid>
      <dc:creator>JMerryline</dc:creator>
      <dc:date>2023-09-08T19:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to iterate through the a Layer and assign a list of Unique ID to a Field from attribute table</title>
      <link>https://community.esri.com/t5/arcmap-questions/trying-to-iterate-through-the-a-layer-and-assign-a/m-p/1327016#M4561</link>
      <description>&lt;P&gt;How/where are you trying to accomplish this?&amp;nbsp; In ArcMap with select and calculate field GP tools, or in a python window?&lt;/P&gt;&lt;P&gt;Also, you say sequential name that 'you have created'.&amp;nbsp; Do you have a separate lookup table or are you wanting it to start with the first FOSC row and append the sequential number to the end of "&lt;SPAN&gt;SPLCNV" for the Station ID field value?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Need some kind of clarification as your examples show different values (other than the sequential number) appended to the end.&amp;nbsp; ( A1A00#, 1B00#,&amp;nbsp;1Z00# ) or are these typos as there doesn't seem to be a pattern other than the last three numbers (where are the A's, B's and Z's coming from).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 21:26:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/trying-to-iterate-through-the-a-layer-and-assign-a/m-p/1327016#M4561</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2023-09-08T21:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to iterate through the a Layer and assign a list of Unique ID to a Field from attribute table</title>
      <link>https://community.esri.com/t5/arcmap-questions/trying-to-iterate-through-the-a-layer-and-assign-a/m-p/1327022#M4562</link>
      <description>&lt;P&gt;On ArcMap Python window.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes I am starting with "&amp;nbsp;&lt;SPAN&gt;with the first FOSC row and append the sequential number to the end of "&lt;/SPAN&gt;&lt;SPAN&gt;SPLCNV" for the Station ID field value?"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;okay so the pattern is&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SPLCNV1A001, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SPLCNV1A002, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SPLCNV1A003…… &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SPLCNV1B001….. all the way to "Z"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SPLCNV1Z001….. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SPLCNV1Z999.... and eventually end at 1Z&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SPLCN = SPLICE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;NV = STATE which is&amp;nbsp;Nevada&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;and then 1A and 001 (number up to 999)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;THANK YOU.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 21:52:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/trying-to-iterate-through-the-a-layer-and-assign-a/m-p/1327022#M4562</guid>
      <dc:creator>JMerryline</dc:creator>
      <dc:date>2023-09-08T21:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to iterate through the a Layer and assign a list of Unique ID to a Field from attribute table</title>
      <link>https://community.esri.com/t5/arcmap-questions/trying-to-iterate-through-the-a-layer-and-assign-a/m-p/1327028#M4563</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/714375"&gt;@JMerryline&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I would like to change the names of a fields in the attribute table called Station ID (to have a sequential name that I have created.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;Have you already coded the logic in Python to generate this sequential value?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 22:18:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/trying-to-iterate-through-the-a-layer-and-assign-a/m-p/1327028#M4563</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2023-09-08T22:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to iterate through the a Layer and assign a list of Unique ID to a Field from attribute table</title>
      <link>https://community.esri.com/t5/arcmap-questions/trying-to-iterate-through-the-a-layer-and-assign-a/m-p/1327058#M4567</link>
      <description>&lt;P&gt;Run this in the Python Window (change the first three lines):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;fc = "TestPolygons"  # path to the feature class or name of the layer
field = "TextField1" # field you want to edit
sql = "Subtype = 'FOSC'" # select the features you want to edit

import string
letters = list(string.ascii_uppercase)
letters.remove("I")
letters.remove("O")

with arcpy.da.UpdateCursor(fc, field, sql) as cursor:
    for i, row in enumerate(cursor):
        letter = letters[int(i/1000)]
        number = i % 1000
        new_id = "SPLCNV1{}{:03}".format(letter, number)
        cursor.updateRow([new_id])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will fail after Z999!&lt;/P&gt;</description>
      <pubDate>Sat, 09 Sep 2023 06:52:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/trying-to-iterate-through-the-a-layer-and-assign-a/m-p/1327058#M4567</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-09-09T06:52:18Z</dc:date>
    </item>
  </channel>
</rss>

