<?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: Sort_management in for loop in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/sort-management-in-for-loop/m-p/502833#M39501</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;the link to your attachment doesn´t work for me:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Invalid Attachment specified. If you followed a valid link, please notify the administrator"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Mar 2013 13:38:33 GMT</pubDate>
    <dc:creator>RaphaelR</dc:creator>
    <dc:date>2013-03-12T13:38:33Z</dc:date>
    <item>
      <title>Sort_management in for loop</title>
      <link>https://community.esri.com/t5/python-questions/sort-management-in-for-loop/m-p/502832#M39500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello, I like to convert tables (100+) living in access database to a geodatabase table, sorting them and deleting unnecessary fields in each table at the same time. I figured I use the &lt;/SPAN&gt;&lt;STRONG&gt;Sort_management&lt;/STRONG&gt;&lt;SPAN&gt; method to convert and sort the tables followed by &lt;/SPAN&gt;&lt;STRONG&gt;DeleteFieldd_management&lt;/STRONG&gt;&lt;SPAN&gt; method to delete the fields. Here is the code that I have written,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy&amp;nbsp; from arcpy import env&amp;nbsp; env.workspace = "E:\Database Project\ACS Estimate 2011\ACS 2011 Tables.mdb"&amp;nbsp; tableList = arcpy.ListTables()&amp;nbsp; for table in tableList:&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; out_dataset = "E:\Database Project\ACS Estimate 2011\Data\To Database\Seq Tables.gdb"&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; #Process: Sort &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Sort_management(table, out_dataset, "GEOID ASCENDING", "UR")&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; #Process: Delete Field &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.DeleteField_management(out_dataset, "FILEID;FILETYPE;STUSAB;CHARITER")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am getting the following error message,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]22543[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Mar 2013 13:25:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sort-management-in-for-loop/m-p/502832#M39500</guid>
      <dc:creator>AdityarajChavada</dc:creator>
      <dc:date>2013-03-12T13:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Sort_management in for loop</title>
      <link>https://community.esri.com/t5/python-questions/sort-management-in-for-loop/m-p/502833#M39501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;the link to your attachment doesn´t work for me:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Invalid Attachment specified. If you followed a valid link, please notify the administrator"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Mar 2013 13:38:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sort-management-in-for-loop/m-p/502833#M39501</guid>
      <dc:creator>RaphaelR</dc:creator>
      <dc:date>2013-03-12T13:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Sort_management in for loop</title>
      <link>https://community.esri.com/t5/python-questions/sort-management-in-for-loop/m-p/502834#M39502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am not sure what happened but I re-added the error message. Let me know if it works now. Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Mar 2013 14:10:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sort-management-in-for-loop/m-p/502834#M39502</guid>
      <dc:creator>AdityarajChavada</dc:creator>
      <dc:date>2013-03-12T14:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Sort_management in for loop</title>
      <link>https://community.esri.com/t5/python-questions/sort-management-in-for-loop/m-p/502835#M39503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;your out_dataset points to a gdb, not a feature classs or table as required.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you could try this, which should give each table in the output database the same name it had in the input database.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;out_dataset = r"E:\Database Project\ACS Estimate 2011\Data\To Database\Seq Tables.gdb" + "\\" + table&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;edit: forgot to make it a raw string.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Mar 2013 14:21:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sort-management-in-for-loop/m-p/502835#M39503</guid>
      <dc:creator>RaphaelR</dc:creator>
      <dc:date>2013-03-12T14:21:02Z</dc:date>
    </item>
  </channel>
</rss>

