Merging multiple shapefiles script not working

2643
2
Jump to solution
04-28-2015 10:51 AM
deleted-user-3rTxRfVTcNm-
New Contributor III

Could someone check this script and tell what is not working, I'm receiving ERROR 000735 which stands for a required parameter that has not been used by the tool. I'm trying to several shapefiles found in folder Merge into a single shapefile. Using another simpler method it works but for that I have to specify location of each shapefile which isn't quite efficient.

import os
import arcpy
from arcpy import env

env.workspace = "D:/M1 Geomatique/Programmation II/Dossier/Merge"

fc = arcpy.ListFeatureClasses(env.workspace)
output = "D:/M1 Geomatique/Programmation II/Dossier/zones.shp"

arcpy.Merge_management(fc, output)
0 Kudos
1 Solution

Accepted Solutions
DarrenWiens2
MVP Honored Contributor

The first parameter for ListFeatureClasses is a wildcard, so it is searching for a feature class equal to your workspace path. Try:

fc = arcpy.ListFeatureClasses()

View solution in original post

2 Replies
DarrenWiens2
MVP Honored Contributor

The first parameter for ListFeatureClasses is a wildcard, so it is searching for a feature class equal to your workspace path. Try:

fc = arcpy.ListFeatureClasses()
deleted-user-3rTxRfVTcNm-
New Contributor III

That's right, it worked. I just check the documentation for ListFeatureClasses and that's true. What a foolish mistake on my part.

Many thanks, Darren.

0 Kudos