Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

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'm trying to find part of a text string in the CLASS_NAME field and return a text string to the Abrv_Name field using the Field Calculator in ArcGIS 10 via a Python parser.

Here is what I have tried among other things with no success.

field calculator image

This worked within the field calculator.field calculator

share|improve this question

You want the in method detailed here:


if Name=="*Emergent*":


if "Emergent" in Name:
share|improve this answer

If you are specifically looking for wildcard behavior (probably not in this case) you can try the fnmatch module. Example:

from fnmatch import fnmatch

if fnmatch(Name, "*Emergent*"):
    return 'EM'
share|improve this answer

Your Answer


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.