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

144
2
02-19-2020 03:03 PM
JerryGarza
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
DavidPike
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
JoshuaBixby
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)