Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • thanks. It seems my script doesn't work with Infield1 etc instead of the actual name of the field. Commented Sep 27, 2011 at 14:57
  • 1
    I believe that in the first instance which uses a "where" statement to return specific rows, you need to have quotations marks "" around the field name in the case of shapefiles and brackets [] for geodatabase feature classes. Commented Sep 27, 2011 at 15:05
  • ahh! I had it working after removing the brackets and changing the field names to the actual field name. But now it doesn't seem to work. I also tried it with the cur method and nothing happens even though it says completed what have I done wrong..I tried with [] instead as well rows = arcpy.UpdateCursor(infc) for row in rows: if row.getValue("Texture") == "Sandy": row.setValue("Richness", "poor") else: row.setValue("Richness", "none") rows.updateRow(row) del rows Commented Sep 27, 2011 at 16:01
  • Could you edit your original question with the new pieces of code you've been trying and having trouble with? It's difficult to piece together what you've done and where things might be going wrong. Commented Sep 27, 2011 at 17:21