<?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: How to permanently reclassify the attribute table records in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/how-to-permanently-reclassify-the-attribute-table/m-p/232840#M13235</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll preface this by saying this is a dangerous script, not to be attempted unless you know what you're doing. It will overwrite your original data, so make a backup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can permanently sort your records using the following script. Beware that once sorted and updated, the object ID will update from 0 - end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; data = []
&amp;gt;&amp;gt;&amp;gt; with arcpy.da.SearchCursor("csv_points","*") as cursor:
...&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data.append(row)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;gt;&amp;gt;&amp;gt; data.sort(key=lambda tup: tup[6]) # sorts based on the 7th field, change if you want.
&amp;gt;&amp;gt;&amp;gt; count = 0
&amp;gt;&amp;gt;&amp;gt; with arcpy.da.UpdateCursor("csv_points","*") as cursor:
...&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row = data[count]
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count += 1
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 11:46:52 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2021-12-11T11:46:52Z</dc:date>
    <item>
      <title>How to permanently reclassify the attribute table records</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-permanently-reclassify-the-attribute-table/m-p/232838#M13233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;How to permanently reclassify "Sort" the attribute table records based on a field value ? I try the geoprocessing tool Sort (Data Management), but this tool always need to write a new output feature or table with a correct values, what I need is to permanently sort the value on the same table or feature class. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ahmad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Feb 2015 19:55:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-permanently-reclassify-the-attribute-table/m-p/232838#M13233</guid>
      <dc:creator>AhmadSALEH1</dc:creator>
      <dc:date>2015-02-18T19:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to permanently reclassify the attribute table records</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-permanently-reclassify-the-attribute-table/m-p/232839#M13234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Question - what is driving the need to have the attribute table permanently sorted?&amp;nbsp; I ask as the attribute table is typically sorted on a "as needed basis", as permanently sorting it can be a bit of work (and will likely get undone the moment one edits a feature class).&amp;nbsp;&amp;nbsp; However, there are various "as needed" solutions depending upon why it needs to be sorted.&amp;nbsp; The best solution will depend on the reason why it needs to be sorted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris Donohue, GISP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Feb 2015 20:57:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-permanently-reclassify-the-attribute-table/m-p/232839#M13234</guid>
      <dc:creator>ChrisDonohue__GISP</dc:creator>
      <dc:date>2015-02-18T20:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to permanently reclassify the attribute table records</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-permanently-reclassify-the-attribute-table/m-p/232840#M13235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll preface this by saying this is a dangerous script, not to be attempted unless you know what you're doing. It will overwrite your original data, so make a backup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can permanently sort your records using the following script. Beware that once sorted and updated, the object ID will update from 0 - end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; data = []
&amp;gt;&amp;gt;&amp;gt; with arcpy.da.SearchCursor("csv_points","*") as cursor:
...&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data.append(row)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;gt;&amp;gt;&amp;gt; data.sort(key=lambda tup: tup[6]) # sorts based on the 7th field, change if you want.
&amp;gt;&amp;gt;&amp;gt; count = 0
&amp;gt;&amp;gt;&amp;gt; with arcpy.da.UpdateCursor("csv_points","*") as cursor:
...&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row = data[count]
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count += 1
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:46:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-permanently-reclassify-the-attribute-table/m-p/232840#M13235</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-11T11:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to permanently reclassify the attribute table records</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-permanently-reclassify-the-attribute-table/m-p/232841#M13236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks darren It worked well with me&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2015 10:48:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-permanently-reclassify-the-attribute-table/m-p/232841#M13236</guid>
      <dc:creator>AhmadSALEH1</dc:creator>
      <dc:date>2015-02-19T10:48:51Z</dc:date>
    </item>
  </channel>
</rss>

