Joshua,
Yeah, so I'm actually using this in Spyder outside of ArcMap, just calling arcpy as another library so the python3 print statements work fine.
I've updated the code a bit further to this:
folder = "C:\\Temp\\Extracted"
gdbList = []
for paths, subdirs, names in os.walk(folder):
for subdir in subdirs:
for name in subdirs:
if name.endswith(".gdb"):
fullName = os.path.join(paths, name)
gdbList.append(fullName)
print("Appended {} to gdbList".format(fullName))
else:
fdList = []
for fgdb in gdbList:
walk = arcpy.da.Walk(fgdb, datatype="FeatureDataset")
for fd in walk:
fdList.append(fd)
else:
print(fdList)
The problem now is that the feature dataset list (fdList) contains the full path including the geodatabase in the following format returned in a list of tuples. The way they are formatted is as follows:
[(u'C:\\Temp\\Extracted\\dir1\\geodatabase01.gdb', [u'Water_Network'], []), (u'C:\\Temp\\Extracted\\dir1\\geodatabase01.gdb\\Water_Network', [], []), (u'C:\\Temp\\Extracted\\dir2\\geodatabase02.gdb', [u'Electric_Network'], []), (u'C:\\Temp\\Extracted\\dir2\\geodatabase02.gdb\\Electric_Network', [], []), (and so on.....)
Again what I'm trying to do is to isolate the feature dataset here and use arcpy copy management to copy it all into a consolidated file geodatabase. I feel like I'm close but missing some glue here, because I can't iterate the copy_management through the fdList object yet.
(edited for a more thorough example of the output)