Hi, I am trying to build a script that combs through all shapefiles within a folder, and all it's subdivisions, and merge them together into a new shapefile. I modified it slightly from another script (sorry can't rem the source to acknowledge...). However, it prompted me this error "ExecuteError: Failed to execute. Parameters are not valid. ERROR 000400: Duplicate inputs are not allowed Failed to execute (Merge)."
The script is as stated below. Can anyone tell what is wrong with it?
Thank you!
import arcpy, os workspace = r'C:\Users\xyz\Desktop\boundary' output_folder = r'C:\Users\xyz\Desktop\New folder' Dict = {} for root, dirs, files in os.walk(workspace): for dir in dirs: arcpy.env.workspace = os.path.join(root,dir) for fc in arcpy.ListFeatureClasses(): if not fc in Dict: Dict[fc] = [] Dict[fc].append(os.path.join(root,fc)) else: Dict[fc].append(os.path.join(root,fc)) for key in Dict: output = os.path.join(output_folder,key[:-4]) + '_merge' arcpy.Merge_management(Dict[key], output) print output + " created" |