If you know all of the possible input values in advance, it is possible to do this with Field Calculator by turning on the "Codeblock" and creating a function like the following:
def classify(name):
if name == 'chris':
return 1
elif name == 'dave':
return 2
elif name == 'tom':
return 3
else:
return 0
And then the expression you would use to calculate another numeric field using that function would be:
classify(!NAME_FIELD!)
If you don't know all of the possible values in advance, or if there are so many that it would be ridiculous to type an elif
statement for each one, you'd probably have to write a custom Python script to do this for you instead of using Field Calculator.
Edit: As discussed in the comments, if you don't care about the specific numeric value assigned to each unique text value, this can probably be done with a global list variable in the codeblock, with the following code (based on your comment):
mylist = []
def classifier(value):
global mylist
if value not in mylist:
mylist.append(value)
return mylist.index(value)