Skip to main content
edited title
Link

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

edited tags; edited title
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

Adding a sequential number using ArcGIS field calculator?

added 264 characters in body
Source Link

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

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)

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)

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)

added 264 characters in body
Source Link
Loading
Source Link
Loading