So far I have a code which iterates through Fefature Classes and ignores all fields of type String, Geometry and OID.
I now try to add some lines which tell python to ignore all NULL values when looping through an integer/float/double field. I work with ArcGIS 10.1 Any ideas how to do so? I believe it must be with SearchCursor but I do not know how.
for FCLASS in FCs:
#Skip all Text. OID and Geometry Fields - unfortunately WID, Shape Area etv is still included
AllFields = [f.name for f in arcpy.ListFields(FCLASS)]
LeaveOutField = [f.name for f in arcpy.ListFields(FCLASS,field_type='String')]
LeaveOutField.extend([f.name for f in arcpy.ListFields(FCLASS,field_type='Geometry')])
LeaveOutField.extend([f.name for f in arcpy.ListFields(FCLASS,field_type='OID')])
attrlist = [x for x in AllFields if x not in LeaveOutField]
# text element that has to change (e.g. title...)
title = arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT", "map_title")[0]
for attr in attrlist:
rows = arcpy.SearchCursor(attr, "row IS NOT NULL")
for row in rows:
if attr["*"] is not None:
#Do Stuff here