Skip to main content
5 of 5
edited title

Adding a sequential number using ArcGIS field calculator to string file and keeping the 0 in front of the number?

I want to know if anyone has a code to count +1 starting at a certain number for Field Calc. ArcGIS. (I.e. 04312, 04313) It also must keep the 0 in front.

rec=0
def autoIncrement():
 global rec
 pStart = 040150117669
 pInterval = 1
 if (rec == 0): 
  rec = pStart 
 else: 
  rec = rec + pInterval 
 return rec

    str(autoIncrement( )).zfill(12)

parsing error syntaxerror:invalid token (line 4)