I have several shapefiles I need to merge. I have been successful in merging all of them except for one using the code bellow. For the one that is not working, I get an error message that reads:
Traceback (most recent call last): File "H:\scripts\sanitary_merge.py", line 19, in <module> arcpy.Merge_management(feature_classes, outshp) File "C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcPy\arcpy\management.py", line 4124, in Merge raise e ExecuteError: ERROR 000302: The input feature types do not match Failed to execute (Merge).
I added in the Walk function, hoping that will fix it, but it is not working still.
import arcpy import fnmatch, os workspace = 'E:\GPS\GPSDATA' outdir = 'E:\GPS\GPSDATA\GPS_merge_layers' search = 'Sanitary.shp' outname = 'Merge_18.shp' feature_classes =  #Empty list to collect shapes. walk = arcpy.da.Walk(workspace, datatype="FeatureClass", type="Point") for dirpath, dirnames, filenames in walk: for filename in filenames: feature_classes.append(os.path.join(dirpath, filename)) if feature_classes: outshp = os.path.join(outdir, os.path.basename(outname[:-4]) + 'tanya_Sanitary.shp') arcpy.Merge_management(feature_classes, outshp)