I want to import data out of a string field in my shapefile to a new field for labeling.
The string field contains river names and codes and I just want to display the text i.e river names
I want to import data out of a string field in my shapefile to a new field for labeling.
The string field contains river names and codes and I just want to display the text i.e river names
In field calculator you can use this python function under the Show Codeblock option:
def removeNumbers(oldfield, newfield):
newfield = ''.join([letter for letter in oldfield if not letter.isdigit()])
return newfield
removeNumbers(!StringNumber!, !NoNumber!)
This question, and its first answer, appear to have been written at a time prior to the Python Parser becoming available for writing Label Expressions.
In this case I think the expression (untested) would be:
def FindLabel ( [StringNumber] ):
S = ''.join([letter for letter in [StringNumber] if not letter.isdigit()])
return S