[GIS] Fnding wildcard string using Field Calculator script code

arcgis-desktopfield-calculatorpython-parser

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

Best Answer

You want the in method detailed here: http://docs.python.org/reference/expressions.html#in

Swap

if Name=="*Emergent*":

with

if "Emergent" in Name:
Related Question