Skip to content

Instantly share code, notes, and snippets.

@alexfriant
Forked from tyler-austin/arcpy_field_names.py
Last active May 17, 2018 16:37
Show Gist options
  • Select an option

  • Save alexfriant/687c5e843c3c9c3140f0b1a025560a7f to your computer and use it in GitHub Desktop.

Select an option

Save alexfriant/687c5e843c3c9c3140f0b1a025560a7f to your computer and use it in GitHub Desktop.
generate a list of field names for a feature class, with datatype and length
import arcpy, os
fc = os.path.join(r"path",r"to",r"your",r"featureclass")
field_list = [[field.name,field.type,str(field.length)] for field in arcpy.ListFields(fc)]
for field in field_list:
print(','.join(field))
@alexfriant
Copy link
Author

made my example feature class path match how it should be entered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment