Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Centerlines feature class to which I transferred attributes from an AddressPoints feature class, and now each centerline has the correct street name but also a street number which I don't need since it is a polyline. I'd like to clear those values from the table, without deleting the street name field.

share|improve this question
up vote 5 down vote accepted

You can use Python and the Field Calculator to strip off the numeric value at the beginning of the string.

Select "Python" at the top, and then enter the following in the Code Block:

def stripDigit(text):
    if text.split(' ',1)[0].isdigit():
        return text.split(' ',1)[1]
    else:
        return text

Then, in the bottom-most field, enter the following:

 stripDigit(!addressField!)

Replacing addressField with the name of your address field, retaining the enclosing exclamation points.

You also do not need to overwrite your existing field; you can add a new field and calculate the values, passing in the existing field as the parameter to the stripDigit function.

share|improve this answer
    
Excellent, I wouldn't say that was exactly what I expected but this is quicker. Prevents me from doing the attribute transfer again. Thanks! – Abraham L Jan 26 at 21:12

Edited

To clarify, do you have multiple fields that you are trying to delete OR multiple values concatenated together in one field that you are trying to split apart or extract a certain portion of. If it is the latter, my apologies, but if it is the former, then my answer still applies.


I usually use the Delete Fields tool in the Data Management Tools > Fields toolbox.

http://support.esri.com/en/knowledgebase/techarticles/detail/27336

How to delete multiple fields in an attribute table?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.