I'm trying to merge a group of like feature classes which are contained within separate feature datasets. I can merge feature classes within a file geodatabase without having issues by creating a list of the feature classes and using Merge_management. The trouble comes when I need to do the same for feature classes contained in feature datasets.
My code so far, looks like:
Output = filepath for new fc
for datasetList1 in arcpy.ListDatasets("","Feature")+ [""]
PointsFC in arcpy.ListFeatureClasses("*_PointName*","Point",datasetList1):
for points in PointsFC:
arcpy.Merge_management(points,Output)
print "Merged Points"
The error message I get states:
PtsMerge already exists.
Failed to execute (Merge).
Best Answer
Here is how I would do it:
Going through the database first on the root level and then for each feature class build up a list of features separated using the describe properties then merge them all at the end.