import arcpy PATCH_MASTER = "C:\\PATCHES\\PATCH_MASTER.shp" rows = arcpy.UpdateCursor(PATCH_MASTER) for row in rows: if row.PATCH_CODE == '*a' or row.PATCH_CODE == '*b': if row.FID_PATCH_ <= 8: row.PATCH_CODE = date_code + "00" + str(row.FID_PATCH_ + 1) rows.updateRow(row) elif row.FID_PATCH_ <= 98 and row.FID_PATCH_ >= 8: row.PATCH_CODE = date_code + "0" + str(row.FID_PATCH_ + 1) rows.updateRow(row) else: row.PATCH_CODE = date_code + str(row.FID_PATCH_ + 1) rows.updateRow(row) del row del rows
#assuming you are checking the LAST character for 'a' or 'b'... if row.PATCH_CODE[-1] in ['a','b']:
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.