Here's what I'm trying to do.
I have a shapefile called 'Roster' with an attribute table like the one below.
| NAME | Age | Room |
|---|
| ***John | 23 | B |
| ***Alice | 56 | C |
| Tina | 34 | A |
I would like to search the shapefile and delete any data under the field 'NAME' where the string starts with '***'
The resulting table would look like this
I figured out how to replace the '***' string with another string, but I can't figure out how to delete the entire cell....
def removeName(shapefilePath):
cursor = arcpy.da.UpdateCursor(shapefilePath, ["NAME"])
for row in cursor:
row[0] = row[0].replace("***", None)
cursor.updateRow(row)
del row
del cursor