I have a script I want to use to update a value for a group of selected features in ArcMap in a string field. I am using the UpdateCursor method but I cannot get the output generated that I want. I know my code is close but something is off. Here is my code:
import arcpy fc = r'D:\_data\sidewalk.gdb\repairs' cursor = arcpy.UpdateCursor(fc) for row in cursor: if row.FixedBy == '': row.FixedBy = 'Contractor' cursor.updateRow(row) print "Processing complete" del row
I am trying to update the string "FixedBy" field where values are blank, not 'Null', with the value 'Contractor'. What is my code missing?