I am running python in the ArcGIS python window. ArcGIS shows error message when trying data merge from arcpy.
File "", line 1, in File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\management.py", line 3816, in Merge raise e ExecuteError: ERROR 000732:
import os
import arcpy
arcpy.env.workspace = "C:/the shapefile folder/"
path = os.listdir("C:/the shapefile folder/")#unzipped all shapefiles to this folder
shapefile = []
for i in path:
suffix = ".shp";
if i.endswith(suffix):#getting all files end with '.shp' to a new list
shapefile.append(i)
arcpy.Merge_management(shapefile,"C:/output folder")
Where is the problem?
line suffix = ".shp";
right? Otherwise that would potentially be causing some of the issues because wouldn't it would be escaping the for loop after the first line.