Select to view content in your preferred language

Arcpy Amateur needing help with a substring find

640
1
06-13-2012 06:47 AM
ZachTirpak
Deactivated User
Hey Acrpy community,

I'm fairly new to Arcpy and the python language in general.  However,I can grasp many aspects and functions of the language and am now trying to run my first script on a table.  Here's my dilemma:


1. I have a (shapefile) table with a row named "Broker_Not" (I am using an update cursor to query, find, and replace values)

2. Within "Broker_Not" I am trying to find records that contain the string "current"

3. As an end result, if "current" is discovered in "Broker_Not", I would like to return a value of "CHECK" in a separate field named "ALIAS".


Any help would be much appreciated.

Thanks!
Tags (2)
0 Kudos
1 Reply
BruceNielsen
Frequent Contributor
Put this statement in your update cursor loop, replacing 'row' with your iterator variable:
if "current" in row.Broker_Not:
    row.ALIAS = "CHECK"
0 Kudos