I would like to fill a column in my attribute table with an string that ends in a numeric value.
Example:
- Object001
- Object002
- Object003
I would like to automate the process of filling in the attribute table.
There is a great post on Adding automated values to attribute field? made previously that explains how to add numbers in series to an attribute table. I would like to build on this code by adding a string invfront of the number.
I'm trying to combine the python code found in the above post with a string but it isn't working. See below for the code which will add a series.
Expression:
autoIncrement()
Expression Type:
PYTHON_9.3
Code Block:
rec=0
def autoIncrement():
global rec
pStart = 1 #adjust start value, if req'd
pInterval = 1 #adjust interval value, if req'd
if (rec == 0):
rec = pStart
else:
rec = rec + pInterval
return rec
However when I try and combine the code in the field like below, I just get an error.
'Object'autoIncrement()
**or**
'Object' & autoIncrement()
My syntax is wrong but I'm not quite sure how to correct it.