tanjahumar

Select by Attributes while looping through a list of fields

Discussion created by tanjahumar on May 13, 2011
Latest reply on May 13, 2011 by tanjahumar
Hi,

I would like to carry out some geoprocessing steps (select, calculate etc) for several fields (measurement results of different years) in one attribute table of my feature class.

I have started a simple script, but I have trouble getting the syntax right or is it anyway not possible?

Any help would be very much appreciated!

Here is where I am struggling:

#generate a list with the fields starting with "no2" (measurement results)
fieldList = arcpy.ListFields("NO2_points","no2*")
for field in fieldList:

# Process: Select
no2_field = field.name
where_clause = "\no2_field >=0 AND \"RASTERVALU\" >0"
arcpy.Select_analysis(NO2_points, NO2_points_Select1, where_clause)

Outcomes