List contents of GDBs in a folder in Excel?

319
1
Jump to solution
03-24-2023 04:18 PM
TimHayes3
Occasional Contributor

I have  25 ArcGIS Desktop 9.0 Personal Geodatabases in a single folder. Each one contains 5 feature classes inside 1 feature dataset. Is there a way to extract the feature class names and GDB name for each and output this into an Excel spreadsheet? 

I need the output to be in two columns:

Col 1 = Feature Class Name

Col 2 = GDB Name

I want to avoid having to copy and past manually. 

I know how to do this with FME using File GDBs, but my version of FME (2021) is not compatible with Personal GDBs. So, I am thinking something like a python script maybe someone can share with me? 

0 Kudos
1 Solution

Accepted Solutions
MobiusSnake
MVP

I don't have a Python script that does this, but this is what I'd do:

  • Create a temporary table to your Excel specs, either in-memory or in a throwaway File GDB
  • Use os.listdir to find all the File GDBs in your source folder, and for each:
    • Use arcpy.ListDatasets() to find all of the feature datasets, and for each:
      • Use arcpy.ListFeatureClasses() to find the feature classes, writing the output to your temporary table with an insert cursor
  • Use the Table to Excel GP tool to create an Excel file from your temporary table
  • Delete your temp table

Do you have a copy of ArcMap or ArcCatalog to use?  ArcGIS Pro does not support Personal GDBs.

View solution in original post

1 Reply
MobiusSnake
MVP

I don't have a Python script that does this, but this is what I'd do:

  • Create a temporary table to your Excel specs, either in-memory or in a throwaway File GDB
  • Use os.listdir to find all the File GDBs in your source folder, and for each:
    • Use arcpy.ListDatasets() to find all of the feature datasets, and for each:
      • Use arcpy.ListFeatureClasses() to find the feature classes, writing the output to your temporary table with an insert cursor
  • Use the Table to Excel GP tool to create an Excel file from your temporary table
  • Delete your temp table

Do you have a copy of ArcMap or ArcCatalog to use?  ArcGIS Pro does not support Personal GDBs.