CoppaCal

How to make a python script for adding successive numbers to the end of a string?

Discussion created by CoppaCal on Nov 2, 2012
Latest reply on Nov 5, 2012 by jamesfreddyc
I'm currently editing two stormwater feature classes, drainage structures and pipes. They each have an ID field that consists of a naming convention that goes something like this, (Sub-Basin 1, Catch Basin 1 = B1-CB-1). After selecting the catch basins that are within sub-basin 1, I can use the attribute editor to change all the selected catch basins to 'B1-CB-'. The question is, how would I add a successive number to the end of that string so that way I get something like this, without having to do it manually.

ID:
B1-CB-1
B1-CB-2
B1-CB-3
etc.

Outcomes