How to calculate a string field with text and sequential numbers in ArcPro

02-19-2020 03:03 PM
New Contributor

I want to calculate a string field for 223 selected points with text 'PVT' plus a sequential number like 'PVT0001' then 'PVT0002' and so forth. What is the most efficient way to do this?

0 Kudos
2 Replies
MVP Frequent Contributor

That doesnt really make sense as the field calculator wont work iteratively in that fashion. To be honest, create your 00001, 00002 in excel when concatenate with 'PVT' and paste the field into your table.

0 Kudos
MVP Esteemed Contributor

I really am not a fan of using Python global in this context, but since you have already started down this path the easiest way to get what you want is to change the final line of the code in your screenshot:

return "PVT{:05}".format(rec)