On Jan 22, 2008 9:04 PM, Jeff Johnson <[EMAIL PROTECTED]> wrote:
> Ed:  The trouble is that the key will look like this 'Safeway' and the
> description will look like this '11222llxxxSafewayBlahBlahBlah'
>
> I need to see if Safeway is in that description.

Jeff,

Python has VERY strong string manipulation capabilities.  Here is what
you need to do.

description="11222llxxxSafewayBlahBlahBlah"  #or whatever value you get
account = None

for vendor in d:
  if not description.find(vendor) == -1:
    account = vendor
    break

if account:
  s = account

Look up the string object methods in the python documentation.
Definitely plenty of info in there.  I used the method find.  It will
search for the passed string and return the index of the beginning
character of the first instance that it finds, or -1 if it doesn't
find the substring in the string.

Hope this helps.

Cheers,

Nate L.


_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]

Reply via email to