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
NAME | Age | Room |
---|---|---|
23 | B | |
56 | C | |
Tina | 34 | A |
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
Solved! Go to Solution.
Charlie Frye wrote:
Thanks Ian--I've been writing VBA lately...
An Esri staffer writing VBA? Isn't that sacrilegious these days seeing that Esri deprecated VBA in 10.1 and has been trying unsuccessfully to retire it since then.