<?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: Help with Python --&amp;gt;Merge_management in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/help-with-python-amp-gt-merge-management/m-p/420492#M14163</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I checked my code and i figured out the problem ..my list should only have .shp files, ive modifed my code and its working now :)))&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Sep 2011 02:44:57 GMT</pubDate>
    <dc:creator>sids</dc:creator>
    <dc:date>2011-09-20T02:44:57Z</dc:date>
    <item>
      <title>Help with Python --&amp;gt;Merge_management</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/help-with-python-amp-gt-merge-management/m-p/420491#M14162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been working on a Python script that will go into multiple sub folders of the main folder and puts all the files with the same name in a list, and then merge them together. Everything works until the Merge_management tool, i get the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;File "H:\Python\Practice\Sidra Scripts\test.py", line 31, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Merge_management(fencePoList, outputName)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\management.py", line 3124, in Merge&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;raise e&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The script is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import os&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from arcpy import env&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.overwriteoutput = 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;inputFolder= "H:\\Python\\Practice\\SampleData\\\Survey_data"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;targetFileName= "H:\\Python\\Practice\\SampleData\\Survey_data\\Merged_Posts.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# Create the empty list&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fencePoList= []&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for root, dirs, files in os.walk(inputFolder, topdown=True):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for filename in files:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if filename[-6]=="P":&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#print os.path.join(root, filename)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fencePosts = str(os.path.join(root, filename))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fencePoList.append(fencePosts)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Format the list of shapefiles properly for the merge tool&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#mergeSHP = '"'+';'.join(fencePoList)+'"'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#print mergeSHP&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Determine the new output feature class path and name&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outputName = os.path.join(inputFolder, "Merged_Posts.shp")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#Merging the fence_pole files in all the folders&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print "starting merge"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Merge_management(fencePoList, outputName)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print "ending merge"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.AddMessage(arcpy.GetMessages())&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#except Exception, ErrorDesc:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#If an error set output boolean parameter "Error" to True.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# arcpy.AddError(str(ErrorDesc)) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# row = None&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# rows = None&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope someone can help! &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2011 02:08:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/help-with-python-amp-gt-merge-management/m-p/420491#M14162</guid>
      <dc:creator>sids</dc:creator>
      <dc:date>2011-09-20T02:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Python --&gt;Merge_management</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/help-with-python-amp-gt-merge-management/m-p/420492#M14163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I checked my code and i figured out the problem ..my list should only have .shp files, ive modifed my code and its working now :)))&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2011 02:44:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/help-with-python-amp-gt-merge-management/m-p/420492#M14163</guid>
      <dc:creator>sids</dc:creator>
      <dc:date>2011-09-20T02:44:57Z</dc:date>
    </item>
  </channel>
</rss>

