featureclass = r"c:\my.gdb\myfc" field = "idfield" id = 1 with arcpy.da.UpdateCursor(featureclass, field) as cur: for row in cur: cur.updateRow(["FIT-{0}".format(id)]) id += 1
rec=0 def autoIncrement(): global rec pStart = 2555 #adjust start value, if req'd pInterval = 1 #adjust interval value, if req'd if (rec == 0): rec = pStart else: rec = rec + pInterval return "FIT-{0}".format(rec)
def addone(fld): if not fld is None: temp = fld.split('/') num = int(temp[1]) + 1 # this will delete leading zeros newnum = str(num).zfill(2) # change 2 to to however many zeros you want to pad the value by return "{0}/{1}".format(temp[0], newnum)
Ingelogde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Maak gratis een account aan.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.