Hello,
For every field within every feature class in my dataset, I would like to produce a list with the following data:
1. Field Name
2. Field Data Type
3. Field Length
4. Field Domain
5. Count of NULL values in field
I have a script that produces 1-4 but can't seem to figure out how to produce number 5.
My current script:
arcpy.env.workspace = r"C:\gdblocation"
fcList = arcpy.ListFeatureClasses("*")
for fc in fcList:
print(fc)
fields = arcpy.ListFields(fc)
for field in fields:
print("{0},{1},{2}"
.format(field.name, field.type, field.length, field.domain))
Example of current output for each field in each feature class:
- NAME, DATA TYPE, LENGTH, DOMAIN
What I'm trying to produce:
- NAME, DATA TYPE, LENGTH, DOMAIN, # of NULL VALUES
Any advice?
Thanks!