<?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: Table Exports to CSV file in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/table-exports-to-csv-file/m-p/1475771#M45162</link>
    <description>&lt;P data-unlink="true"&gt;You can use Python to open a &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/searchcursor-class.htm" target="_self"&gt;search cursor&lt;/A&gt; using the fields in the order you want with a sql_clause parameter to sort on the field you want. Iterate through each row of the cursor and write the data to your text file. You can even use the &lt;A href="https://docs.python.org/3/library/csv.html" target="_self"&gt;Python CSV module&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Mon, 20 May 2024 18:59:34 GMT</pubDate>
    <dc:creator>BlakeTerhune</dc:creator>
    <dc:date>2024-05-20T18:59:34Z</dc:date>
    <item>
      <title>Table Exports to CSV file</title>
      <link>https://community.esri.com/t5/data-management-questions/table-exports-to-csv-file/m-p/1475713#M45161</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I was given a seemingly simple task at work to produce a .txt file with a set of data displayed in ascending order of a specific field of a feature class.&lt;/P&gt;&lt;P&gt;I quickly found that I was not able to export a table from Pro to display the data in the order that I wanted. Every time I exported, the resulting table would be in ascending order of the OBJECT ID field, I was never able to export the table in ascending order of the field of my choosing.&lt;/P&gt;&lt;P&gt;I did manage a work around in that I exported the data as a CSV file, opened it in Excel, deleted the column that contained the OBJECT ID field, then saved the file as a .txt file, opened it in Notepad ++, and with my target field now being the first column, I sorted the data in ascending order using the tool in Notepad ++.&lt;/P&gt;&lt;P&gt;I was just curious if anyone has come across the same issue and knows of a way to export a table in ascending order of a field&amp;nbsp;&lt;EM&gt;other than the&amp;nbsp;&lt;/EM&gt;OBJECT ID field, straight from Pro?&lt;/P&gt;&lt;P&gt;Thanks for any insights!&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2024 17:56:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/table-exports-to-csv-file/m-p/1475713#M45161</guid>
      <dc:creator>KRobinson-GIS</dc:creator>
      <dc:date>2024-05-20T17:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Table Exports to CSV file</title>
      <link>https://community.esri.com/t5/data-management-questions/table-exports-to-csv-file/m-p/1475721#M45163</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/795077"&gt;@KRobinson-GIS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm away from my work machine currently and am not able to test my theory entirely, but I have an idea!&lt;/P&gt;&lt;P&gt;Is it possible for you to swap the column locations to the desired ascending/descending column instead of the OBJECTID column? Here is what I mean:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="swap.gif" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104671i1602F916D1F6987B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="swap.gif" alt="swap.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hope that helps!&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2024 17:59:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/table-exports-to-csv-file/m-p/1475721#M45163</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2024-05-20T17:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: Table Exports to CSV file</title>
      <link>https://community.esri.com/t5/data-management-questions/table-exports-to-csv-file/m-p/1475771#M45162</link>
      <description>&lt;P data-unlink="true"&gt;You can use Python to open a &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/searchcursor-class.htm" target="_self"&gt;search cursor&lt;/A&gt; using the fields in the order you want with a sql_clause parameter to sort on the field you want. Iterate through each row of the cursor and write the data to your text file. You can even use the &lt;A href="https://docs.python.org/3/library/csv.html" target="_self"&gt;Python CSV module&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2024 18:59:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/table-exports-to-csv-file/m-p/1475771#M45162</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2024-05-20T18:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Table Exports to CSV file</title>
      <link>https://community.esri.com/t5/data-management-questions/table-exports-to-csv-file/m-p/1475811#M45164</link>
      <description>&lt;P&gt;From what I can tell, They will always be exported by sort order of OBJECTID.&amp;nbsp; You can use the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/sort.htm" target="_self"&gt;Sort GP tool&lt;/A&gt;&amp;nbsp;(or python) to sort the table on a field that you want (which creates a new table/FC), then export that new, exported table as the OBJECTID's will be relative to the new 'sorted' field.&lt;/P&gt;&lt;P&gt;If nothing else works, you can do the workaround without the step saving to .txt file.&lt;/P&gt;&lt;P&gt;In Excel, open csv, sort by the field you want, save.&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2024 19:42:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/table-exports-to-csv-file/m-p/1475811#M45164</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2024-05-20T19:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: Table Exports to CSV file</title>
      <link>https://community.esri.com/t5/data-management-questions/table-exports-to-csv-file/m-p/1475973#M45165</link>
      <description>&lt;P&gt;You can do it all in pro. when Exporting a table of the feature class, it has options to choose fields you want to include as well as sorting.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HabtamneshGoite_0-1716266866299.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104705iCF680E68CDD3715B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HabtamneshGoite_0-1716266866299.png" alt="HabtamneshGoite_0-1716266866299.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 04:50:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/table-exports-to-csv-file/m-p/1475973#M45165</guid>
      <dc:creator>HabtamneshGoite</dc:creator>
      <dc:date>2024-05-21T04:50:39Z</dc:date>
    </item>
  </channel>
</rss>

