-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
made my example feature class path match how it should be entered.