Skip to content
TheChatArchiveThe Chat Archive
Kimikimi-k2-0711-preview· Moonshot AIHugging Face LMArena Human Preference 140K

export field structure from a file geodatabase

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Mistralmagistral-medium-2506’s answer.
  1. User

    export field structure from a file geodatabase

  2. Kimi Assistant

    To export the field structure (schema) from a File Geodatabase (GDB) in ArcGIS or using Python, you have a few options depending on your needs. Here's how to do it:


    ✅ Option 1: Using ArcGIS Pro (GUI)

    1. Open ArcGIS Pro.
    2. In the Catalog pane, navigate to your File Geodatabase.
    3. Right-click the feature class or table you want the schema from.
    4. Choose Data > Export Features.
    5. In the Export Features pane:
      • Set Output Location to a new GDB or folder.
      • Set Output Name.
      • Click the Configuration button (gear icon).
      • Under Fields, choose Schema Only.
    6. Run the tool. This creates an empty feature class with the same field structure.

    ✅ Option 2: Using Python (arcpy)

    If you want to export just the field names, types, and properties, use this script:

    import arcpy
    
    # Path to your feature class or table
    gdb_path = r"C:\Path\To\Your.gdb"
    fc_name = "YourFeatureClass"
    fc = os.path.join(gdb_path, fc_name)
    
    # Get field info
    fields = arcpy.ListFields(fc)
    
    # Print or save to CSV
    import csv
    
    output_csv = r"C:\Temp\field_structure.csv"
    with open(output_csv, 'w', newline='') as csvfile:
        writer = csv.writer(csvfile)
        writer.writerow(["Field Name", "Type", "Length", "Precision", "Scale", "IsNullable", "Required"])
        for f in fields:
            writer.writerow([
                f.name,
                f.type,
                f.length,
                f.precision,
                f.scale,
                f.isNullable,
                f.required
            ])
    
    print("Field structure exported to:", output_csv)
    

    ✅ Option 3: Export Schema Only (Empty GDB)

    To create a new GDB with only the schema (no data):

    import arcpy
    
    in_gdb = r"C:\Path\To\Your.gdb"
    out_gdb = r"C:\Temp\SchemaOnly.gdb"
    
    # Create new GDB
    arcpy.management.CreateFileGDB(os.path.dirname(out_gdb), os.path.basename(out_gdb))
    
    # List all feature classes
    arcpy.env.workspace = in_gdb
    fcs = arcpy.ListFeatureClasses()
    
    for fc in fcs:
        arcpy.conversion.FeatureClassToFeatureClass(
            in_features=fc,
            out_path=out_gdb,
            out_name=fc,
            where_clause="1=0"  # No data
        )
    

    Summary Table

    MethodOutput TypeIncludes Data?Notes
    ArcGIS Pro GUINew GDB or FC❌Easy for one-off
    Python CSVCSV file❌Good for documentation
    Python ScriptNew GDB with schema❌Automatable

    Let me know if you want to include domains, subtypes, or relationships — those require a bit more.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.