<?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: Iterate tables through Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/iterate-tables-through-python/m-p/230940#M17911</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using the suggestions I adjusted the scrip to look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;res_500yrsumm = os.path.join(output_workspace, str("res_500yrsumm"))&lt;/P&gt;&lt;P&gt;summ_res = os.path.join(output_workspace, str("summ_res"))&lt;/P&gt;&lt;P&gt;arcpy.CopyRows_management(res_500yrsumm, summ_res)&lt;/P&gt;&lt;P&gt;arcpy.DeleteRows_management(summ_res)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables = arcpy.ListTables("res*")&lt;/P&gt;&lt;P&gt;for table in tables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Append_management(table, summ_res, "NO_TEST", "", "")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And everything is doing what it is suppose to be doing.&amp;nbsp; Thanks for the tips!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Jun 2015 18:34:41 GMT</pubDate>
    <dc:creator>MeredithGreen</dc:creator>
    <dc:date>2015-06-15T18:34:41Z</dc:date>
    <item>
      <title>Iterate tables through Python</title>
      <link>https://community.esri.com/t5/python-questions/iterate-tables-through-python/m-p/230937#M17908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a script listed below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables = arcpy.ListTables("res*")&lt;/P&gt;&lt;P&gt;for table in tables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; res_500yrsumm = os.path.join(output_workspace, str("res_500yrsumm"))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; res_summ = os.path.join(output_workspace, str("res_summ"))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyRows_management(res_500yrsumm, res_summ)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.DeleteRows_management(res_summ)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Append_management(table, res_summ, "NO_TEST", "", "")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are seven tables it is suppose to iterate through and append to res_summ but for some reason it only does one table and stops.&amp;nbsp; I appended all of the tables separately in ArcMap using the append tool to make sure there were no issues with fields matching and it worked fine.&amp;nbsp; Is there an error in my script I'm not seeing?&amp;nbsp; Any help would be greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 16:16:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterate-tables-through-python/m-p/230937#M17908</guid>
      <dc:creator>MeredithGreen</dc:creator>
      <dc:date>2015-06-15T16:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate tables through Python</title>
      <link>https://community.esri.com/t5/python-questions/iterate-tables-through-python/m-p/230938#M17909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Meredith, It looks like you are creating your res_summ table anew for each iteration, overwriting the previous one each time. Try taking the copy/delete rows outside of the loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 16:26:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterate-tables-through-python/m-p/230938#M17909</guid>
      <dc:creator>SepheFox</dc:creator>
      <dc:date>2015-06-15T16:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate tables through Python</title>
      <link>https://community.esri.com/t5/python-questions/iterate-tables-through-python/m-p/230939#M17910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Since you've already made a list of tables (the input tables argument for Append can be a list), you can use that in Append. No loop required.&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;tables = arcpy.ListTables("res*")
res_summ = os.path.join(output_workspace, str("res_summ"))
arcpy.Append_management(tables, res_summ, "NO_TEST", "", "")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:13:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterate-tables-through-python/m-p/230939#M17910</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-11T11:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate tables through Python</title>
      <link>https://community.esri.com/t5/python-questions/iterate-tables-through-python/m-p/230940#M17911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using the suggestions I adjusted the scrip to look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;res_500yrsumm = os.path.join(output_workspace, str("res_500yrsumm"))&lt;/P&gt;&lt;P&gt;summ_res = os.path.join(output_workspace, str("summ_res"))&lt;/P&gt;&lt;P&gt;arcpy.CopyRows_management(res_500yrsumm, summ_res)&lt;/P&gt;&lt;P&gt;arcpy.DeleteRows_management(summ_res)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables = arcpy.ListTables("res*")&lt;/P&gt;&lt;P&gt;for table in tables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Append_management(table, summ_res, "NO_TEST", "", "")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And everything is doing what it is suppose to be doing.&amp;nbsp; Thanks for the tips!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 18:34:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterate-tables-through-python/m-p/230940#M17911</guid>
      <dc:creator>MeredithGreen</dc:creator>
      <dc:date>2015-06-15T18:34:41Z</dc:date>
    </item>
  </channel>
</rss>

