Exporting gdb tables to excel in folder containing gdb?

المشرف العام

Administrator
طاقم الإدارة
So i have several folders which each contain a gdb.

Now, I export the attribute tables of polygon feature classes using the following code (probably could use some optimization):

folder = arcpy.GetParameterAsText(0)for dirpath, dirnames, filenames in arcpy.da.Walk(folder, datatype="FeatureClass",type="Polygon"): for filename in filenames: fc = os.path.join(dirpath, filename) table = dirpath + os.sep + filename + "_Table" result = arcpy.GetCount_management(fc) if int(result.getOutput(0)) > 0: print "Creating " + table arcpy.CopyRows_management(fc, table)Output looks like:

-folder--subfolder1---*.gdb
 
أعلى