I have about 100 feature classes inside twenty feature datasets inside a geodatabase. We have about 50 individual geodatabases. I want to load all geodatabases one by one in a one single master geodatabase. I believe anyone with experience in Python programing can help me. I don't have any coding experience.
closed as off-topic by Vince, John Powell, Erica, Mapperz♦ Dec 8 '15 at 16:56
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions seeking help to debug/write/improve code must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Providing a clear problem statement and evidence of a code attempt will help others to help you. See: How to create a Minimal, Complete, and Verifiable example." – Vince, John Powell, Erica, Mapperz
arcpy.da.Walk was designed for this type of operation. This example assumes that all of your feature classes have unique names. If not, you will need to add logic to automatically rename duplicates.
import arcpy, os inws = r"C:\temp" # Input workspace outws = r'C:\temp\out_data.gdb' # Output workspace fcs =  # Create an empty list to store fc paths # You can specify the type of feature classes too if you wish walk = arcpy.da.Walk(inws, datatype="FeatureClass") for dirpath, dirnames, filenames in walk: for filename in filenames: fcs.append(os.path.join(dirpath, filename)) # Loop through the fcs list and copy to a new file geodatabase # This assumes all fc names are unique for fc in fcs: arcpy.CopyFeatures_management(fc, os.path.join(outws, os.path.basename(fc)))