I add an if statement but the null and blanks one don't get updated sequentially. I get no error's, i did add "=" to line 26.
RD_ID += 1
import arcpy
fc = r'C:\Temp\Address_Points.shp'
#arcpy.CalculateField_management(fc, "RD_ID", '""" """', "PYTHON")
rd_list = []
with arcpy.da.SearchCursor(fc, ["RD_ID"]) as cursor:
for row in cursor:
try:
if "CC" in row[0]:
rd_list.append(int(row[0].strip("CC")))
except TypeError:
pass
del cursor
rd_list.sort()
RD_ID = rd_list[-1] + 1
#whereclause = "RD_ID = '%CC%'"
with arcpy.da.UpdateCursor(fc, "RD_ID") as rows:
for row in rows:
if row[0] in (""," ", None):
row[0] = 'CC%05d' %RD_ID
RD_ID += 1
rows.updateRow(row)
del row
print 'Done'