<?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: gp.Merge_management using list in python in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/gp-merge-management-using-list-in-python/m-p/392683#M13372</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;bposthumus: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My output path contained all the correct and required slashes, sorry that I did not post it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;tempWS = "E:\\FMP_Reports_Tool\\tempWS.mdb\\"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;_garret_: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I originally had used the Value table method but it kept crashing so I switched to creating the string.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I followed a number of your ideas, changing all my paths from \\ to /, and using the&amp;nbsp; os.path.join (tempws, tableName)...&amp;nbsp; which didn't work either!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just in a round about sort of trial and error, frustrating , smash my face on the keyboard, way, I&amp;nbsp; started switching some of my inputs back to the way I had before I tried your&amp;nbsp; methods...&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Some where in the middle it worked!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I have a bit of a spaghetti factory code, all mixed up using&amp;nbsp; various different methods to create the out puts and it works and I don't want to touch a thing.&amp;nbsp; So dirty it will stay.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am still not sure why it wouldn't work though I suspect it possibly could have been the cursor used to create the list or value table, holding a lock on the variable?&amp;nbsp; I dont know.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any way thanks again everybody for the suggestions.&amp;nbsp; Today I am a Happy Gisser!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Aug 2010 13:16:19 GMT</pubDate>
    <dc:creator>JamesHood</dc:creator>
    <dc:date>2010-08-19T13:16:19Z</dc:date>
    <item>
      <title>gp.Merge_management using list in python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/gp-merge-management-using-list-in-python/m-p/392678#M13367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello again, colleagues, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a problem executing gp.merge_management&amp;nbsp; or gp.merge tool within a script. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My script needs to merge a varying number of tables together.&amp;nbsp; In this instance there are 7, though this number can and will change.&amp;nbsp;&amp;nbsp;&amp;nbsp; In order to accomplish this I have used various different scripting techniques, all of which have failed. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I feel like I am so close and it should work, but there is something fishy stopping it, that I just can�??t see. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error I continually get is:&amp;nbsp; #ERROR 000582: Error occurred during execution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;Error code: 000582: Error occurred during execution.&lt;BR /&gt;Description: An error occurred during the tool's validation or execution. No specific messages were available. &lt;BR /&gt;The validation process checks that a tool's set of parameter values are of the expected number, data type, and value.&lt;BR /&gt;Solution: Check that a tool's required parameter values are specified and are the correct data type. If the parameters are entered correctly, it may be possible the execute routine for the tool is invalid. Have the developer of the custom tool check the Execute implementation. &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See: &lt;/SPAN&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?tocVisable=1&amp;amp;ID=-1&amp;amp;TopicName=tool%20errors%20and%20warnings:576-600&amp;amp;pid=1" rel="nofollow noopener noreferrer" target="_blank"&gt;http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?tocVisable=1&amp;amp;ID=-1&amp;amp;TopicName=tool%20errors%20and%20warnings:576-600&amp;amp;pid=1&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please see my attached code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

Stage2Tbl = r"E:\\FMP_Reports_Tool\\tempWS\\Stage2Tbl"

try:

&amp;nbsp;&amp;nbsp;&amp;nbsp; mergeString = r""
&amp;nbsp;&amp;nbsp;&amp;nbsp; for tbl in mlist:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mergeString = mergeString + tempWS + tbl + ";"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp;&amp;nbsp;&amp;nbsp; insertStr = mergeString.rstrip(";")
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.Merge_management(str(insertStr), Stage2Tbl, "")&amp;nbsp;&amp;nbsp;&amp;nbsp; 

except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Get the geoprocessing error messages
&amp;nbsp;&amp;nbsp;&amp;nbsp; msgs = gp.GetMessage(0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; msgs += gp.GetMessages(2)
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Return gp error messages for use with a script tool
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddError(msgs)
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Print gp error messages for use in Python/PythonWin
&amp;nbsp;&amp;nbsp;&amp;nbsp; print msgs

&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;The variable&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mlist&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; is a list that contains the output names of tables that were created into the temp workspace earlier in the script.&amp;nbsp; This list is then used to select those same tables, and merge them back together.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt; I create the mergeString variable from the&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mlist&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , to be used in the actual gp.merge tool.&amp;nbsp; &lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt; I was concerned that there may be a problem reading the workspace strings in the mergeString, so I added the �??r�?� to create a raw string.&amp;nbsp; This had no effect.&amp;nbsp; &lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt; I read previously in another thread that I might need to convert my string, to string within the actual tool.&amp;nbsp; I added this but had again the same result. &lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt; I used my string variable&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insertStr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in the merge tool of a separate script and it worked just fine!&amp;nbsp; So it just will not work here.&amp;nbsp; &lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;SPAN&gt;Please, are there any suggestions on anything further I should try or other methods which might work in this circumstance? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using ArcInfo 9.3 and python 2.5 if that helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- James&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ps.&amp;nbsp; This is worth at least 3 Stars on the old forums...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:59:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/gp-merge-management-using-list-in-python/m-p/392678#M13367</guid>
      <dc:creator>JamesHood</dc:creator>
      <dc:date>2021-12-11T17:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: gp.Merge_management using list in python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/gp-merge-management-using-list-in-python/m-p/392679#M13368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In this line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mergeString = mergeString + tempWS + tbl + ";" &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...I'm assuming "tbl" is a table in the workspace "tempWS", and should therefore read:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mergeString = mergeString + tempWS + "\\" + tbl + ";"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit: (unless you have the backslash at the end of "tempWS" ...what's the value of your variable "tempWS"?)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Aug 2010 20:10:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/gp-merge-management-using-list-in-python/m-p/392679#M13368</guid>
      <dc:creator>BradPosthumus</dc:creator>
      <dc:date>2010-08-18T20:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: gp.Merge_management using list in python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/gp-merge-management-using-list-in-python/m-p/392680#M13369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are you sure that this evil blank except statement (normally one says that it is best practice to catch only specific Exceptions - never ALL possible exceptions as this may lead to errors which are hard to track down. But in the ArcGIS world this seems to be...well..different. At least for many 9.3 examples) does not catch some python error which you are not aware of?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And just a tip for file name/path operations:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use forward slashes instead of backwards slashes which may be less error-prone as you don't have to fight with escape sequences&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;path = 'c:/test'&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;instead of&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;path = 'c:\\test'&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For path operations you might want to try os.path.join:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import os.path
base_dir = 'c:/test/shp'
shape_name = 'test.shp'
shape_path = os.path.join(base_dir, shape_name)&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;This is less error-prone as you don't need to take care of missing slashes at the end of base_dir etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know if this solves your problem, but I will have to do the exact same task tomorrow so maybe I can then give you some more useful information.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:59:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/gp-merge-management-using-list-in-python/m-p/392680#M13369</guid>
      <dc:creator>KarlOrmer</dc:creator>
      <dc:date>2021-12-11T17:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: gp.Merge_management using list in python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/gp-merge-management-using-list-in-python/m-p/392681#M13370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It is hard to track your exact problem down as I don't know the content of your variables. But the following might help you as it is how I have just solved my problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcgisscripting, os.path

gp = arcgisscripting.create(9.3)
input_tables = [u'table_1', u'table_2', u'table_3']
in_dir = u'c:/path_to_my_tables'
out_dir = u'c:/whatever'

# let's use absolute file paths (c:/path_to_my_tables/table_1) and let's use an
# ESRI value table instead of building an insert string ('c:/.../table1;c:/..../table2')
# btw, why does the tool not accept a python list as input argument?
val_tab = gp.CreateObject("ValueTable")
for table in input_tables:
&amp;nbsp;&amp;nbsp;&amp;nbsp; val_tab.AddRow(os.path.join(in_dir, table))
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
merged_table = os.path.join(out_dir, 'merged_table')
gp.Merge_management(val_tab, merged_table, '') &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:59:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/gp-merge-management-using-list-in-python/m-p/392681#M13370</guid>
      <dc:creator>KarlOrmer</dc:creator>
      <dc:date>2021-12-11T17:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: gp.Merge_management using list in python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/gp-merge-management-using-list-in-python/m-p/392682#M13371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's how I do it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Note: I'm printing the 'path' variable to make sure everything looks right during testing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
# Start a blank list for appending
list = []&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

for tbl in mlist:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Create the full path
&amp;nbsp;&amp;nbsp;&amp;nbsp; path = tempWS+tbl
&amp;nbsp;&amp;nbsp;&amp;nbsp; print path
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Append all the paths together into one big list&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; filepath = list.append(path)

## Create the proper format for the Merge tool
# Separate each item in the list by a ';' and put "" around the whole thing.
mergedlist = '"'+';'.join(list)+'"'

try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Merging to get Output.dbf..."&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.merge_management(mergedlist, "Ouptput.dbf")
&amp;nbsp;&amp;nbsp;&amp;nbsp; print gp.GetMessages()
except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "\n *** ERROR: Output.dbf failed to merge *** \n"
&amp;nbsp;&amp;nbsp;&amp;nbsp; print gp.GetMessages()
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:59:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/gp-merge-management-using-list-in-python/m-p/392682#M13371</guid>
      <dc:creator>RDHarles</dc:creator>
      <dc:date>2021-12-11T17:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: gp.Merge_management using list in python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/gp-merge-management-using-list-in-python/m-p/392683#M13372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;bposthumus: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My output path contained all the correct and required slashes, sorry that I did not post it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;tempWS = "E:\\FMP_Reports_Tool\\tempWS.mdb\\"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;_garret_: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I originally had used the Value table method but it kept crashing so I switched to creating the string.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I followed a number of your ideas, changing all my paths from \\ to /, and using the&amp;nbsp; os.path.join (tempws, tableName)...&amp;nbsp; which didn't work either!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just in a round about sort of trial and error, frustrating , smash my face on the keyboard, way, I&amp;nbsp; started switching some of my inputs back to the way I had before I tried your&amp;nbsp; methods...&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Some where in the middle it worked!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I have a bit of a spaghetti factory code, all mixed up using&amp;nbsp; various different methods to create the out puts and it works and I don't want to touch a thing.&amp;nbsp; So dirty it will stay.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am still not sure why it wouldn't work though I suspect it possibly could have been the cursor used to create the list or value table, holding a lock on the variable?&amp;nbsp; I dont know.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any way thanks again everybody for the suggestions.&amp;nbsp; Today I am a Happy Gisser!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Aug 2010 13:16:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/gp-merge-management-using-list-in-python/m-p/392683#M13372</guid>
      <dc:creator>JamesHood</dc:creator>
      <dc:date>2010-08-19T13:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: gp.Merge_management using list in python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/gp-merge-management-using-list-in-python/m-p/392684#M13373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Here's how I do it.&lt;BR /&gt;Note: I'm printing the 'path' variable to make sure everything looks right during testing.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
# Start a blank list for appending
list = []&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

for tbl in mlist:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Create the full path
&amp;nbsp;&amp;nbsp;&amp;nbsp; path = tempWS+tbl
&amp;nbsp;&amp;nbsp;&amp;nbsp; print path
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Append all the paths together into one big list&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; filepath = list.append(path)

## Create the proper format for the Merge tool
# Separate each item in the list by a ';' and put "" around the whole thing.
mergedlist = '"'+';'.join(list)+'"'

try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Merging to get Output.dbf..."&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.merge_management(mergedlist, "Ouptput.dbf")
&amp;nbsp;&amp;nbsp;&amp;nbsp; print gp.GetMessages()
except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "\n *** ERROR: Output.dbf failed to merge *** \n"
&amp;nbsp;&amp;nbsp;&amp;nbsp; print gp.GetMessages()
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This snippet of code worked for my merge problem.&amp;nbsp; Thank you very much rdharles.&amp;nbsp; This is how I would do it too. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:59:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/gp-merge-management-using-list-in-python/m-p/392684#M13373</guid>
      <dc:creator>ArcGISUser</dc:creator>
      <dc:date>2021-12-11T17:59:55Z</dc:date>
    </item>
  </channel>
</rss>

