1

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

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Jul 19, 2012 at 10:11
1
  • 1
    could you post an example of the river names and codes? Commented Jul 19, 2012 at 10:41

2 Answers 2

1

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!)
answered Jul 19, 2012 at 11:33
0

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
answered Sep 1, 2015 at 3:56

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.