I need to update the third row with the second row, the issue is that the entries are not consistent.
Field three has entities like so;
PLAT - final
PLAT -short
PLAT -prelim
PLAT -Reserved
PLAT -asdf
PLAT -lkjhh
etc.
I would like to update row 3 with just Plat. I don't want to write a pair for each one. So can I do a wild card?
I tried 'PLAT*' on line 5 but it didn't work.
import arcpy
fc = 'C:/Temp/permits.gdb/test'
assignName = {"BP" : "BuildingPermit", "FMEA" : "FEMA_LOMAR", 'PLAT*': "Sub"}
#fields = ["OBJECTID", "Type", "Type2"]
print(assignName)
cursor = arcpy.da.UpdateCursor(fc,["OBJECTID", "Type", "Type2"])
for row in cursor:
if row[1] in assignName:
print (assignName[row[1]])
row[2] = assignName[row[1]]
cursor.updateRow(row)