import os, sys, arcpy
BaseFolder = r'c:\your\folder' # change this to match your 'top level' folder
ListOfLotsToMerge = [] # an empty list
# walk the folders and databases from basefolder down
# but only polygon feature classes
for Path, Folders, FeatureClasses in arcpy.da.Walk(BaseFolder,datatype='FeatureClass',type='Polygon'):
for ThisFC in FeatureClasses:
if ThisFC.lower() == 'lot': # does this feature class have the right name?
# add the full path to this feature class to the list
ListOfLotsToMerge.append(os.path.join(Path,ThisFC))
# merge them all into a single shapefile called AllTheLots in your base folder
arcpy.Merge_management(ListOfLotsToMerge,os.path.join(BaseFolder,'AllTheLots.shp'))
import os, sys, arcpy
BaseFolder = r'c:\your\folder' # change this to match your 'top level' folder
ListOfLotsToMerge = [] # an empty list
# walk the folders and databases from basefolder down
# but only polygon feature classes
for Path, Folders, FeatureClasses in arcpy.da.Walk(BaseFolder,datatype='FeatureClass',type='Polygon'):
for ThisFC in FeatureClasses:
if ThisFC.lower() == 'lot': # does this feature class have the right name?
# add the full path to this feature class to the list
ListOfLotsToMerge.append(os.path.join(Path,ThisFC))
# merge them all into a single shapefile called AllTheLots in your base folder
arcpy.Merge_management(ListOfLotsToMerge,os.path.join(BaseFolder,'AllTheLots.shp'))
import os, sys, arcpy
BaseFolder = sys.argv[1]
OutShapefile = sys.argv[2]
ListOfLotsToMerge = [] # an empty list
# walk the folders and databases from basefolder down
# but only polygon feature classes
for Path, Folders, FeatureClasses in arcpy.da.Walk(BaseFolder,datatype='FeatureClass',type='Polygon'):
for ThisFC in FeatureClasses:
if ThisFC.lower() == 'lot': # does this feature class have the right name?
# add the full path to this feature class to the list
ListOfLotsToMerge.append(os.path.join(Path,ThisFC))
# merge them all into a single shapefile called AllTheLots in your base folder
arcpy.Merge_management(ListOfLotsToMerge,OutShapefile)
import os, sys, arcpy
BaseFolder = sys.argv[1]
OutShapefile = sys.argv[2]
ListOfLotsToMerge = [] # an empty list
# walk the folders and databases from basefolder down
# but only polygon feature classes
for Path, Folders, FeatureClasses in arcpy.da.Walk(BaseFolder,datatype='FeatureClass',type='Polygon'):
for ThisFC in FeatureClasses:
if ThisFC.lower() == 'lot': # does this feature class have the right name?
# add the full path to this feature class to the list
ListOfLotsToMerge.append(os.path.join(Path,ThisFC))
# merge them all into a single shapefile called AllTheLots in your base folder
arcpy.Merge_management(ListOfLotsToMerge,OutShapefile)