ArcGIS Field Calculator – Sorting Feature Class for Sequential ID Field

arcgis-10.0arcgis-desktoparcmapfield-calculatorpython-parser

I am in ArcMap and I want to sort the records based on a field and then do a Calculate Field with an auto-incrementing value with the sort in-place. Any ideas?

It looks like I could get an update cursor on the feature class then do an auto-increment, but I would still like to see if there is a way to do this in the Field Calculator in ArcMap.

Best Answer

Try using Sort (Data Management) followed by Calculate Field (Data Management) using the auto-increment example on the Calculate Field examples help page.

If you need to sort the data and update it in-place (no intermediate dataset), then I think you would have to use an UpdateCursor which can also sort by a field.

Related Question