Select to view content in your preferred language

How to Increment a String ID

05-20-2014 12:21 PM
New Contributor
I'm using ArcMap 10.2 and I have an ID that is part Arcronym part part number.  I have created one script in the field calculator using Python to initially fill the field called FacilityID that I am populating as part of a Post Process.  What I need is a script for after the first run that will get the last three digits that are a number and use this to autopopulate Null FacilityID's.

Here is my original script.

    def autoIncrement():
     global rec
     pStart = 1 
     pInterval = 1
     if (rec == 0): 
      rec = pStart 
      rec += pInterval 
     return "water" + "11" + "-" +  format(rec, '04d')   

Attribute Table :

0 Kudos
0 Replies