I want to print all feature class names along with field names from a GDB, which are having empty/blank records in text file for user. Fields in feature classes are not same. So I want to skip some particular fields which are not requited to check for empty records. Below is my code and I don't know how to skip some fileds
import arcpy
from arcpy import env
env.workspace = r"C:\Users\Test\Basemap.gdb\ROAD"
fclist = arcpy.ListFeatureClasses()
# want to find empty records for below list of feature classes
fields = ["S_CODE","CATEGORY"]
f=open(r'C:\Users\test\List_GDB\Empty_rec.txt','w')
for fc in fclist:
bad_list = []
for field in fields:
#print (fields)
with arcpy.da.SearchCursor(fc, field) as cursor:
for row in cursor:
if row[0] in ["", None, " "]:
bad_list.append(field)
break
f.writelines(fc+"contains empty records in"+str(bad_list)+"\n")
f.close()
Above is GDB structure. Please suggest how to skip particular fields (Ex: CODE, ADDRESS etc) in all feature classes while checking for empty records.