title: Python 2.7 - xlrd - Matching A String To a Cell Value
body: <p>Using Python 2.7 on Mac OSX Lion with <code>xlrd</code></p>
  
  <p>My problem is relatively simple and straightforward.  I'm trying to match a string to an excel cell value, in order to insure that other data, within the row that value will be matched to, is the correct value.</p>
  
  <p>So, say for instance that <code>player = 'Andrea Bargnani'</code> and I want to match a row that looks like this:</p>
  
  <pre><code> Draft      Player                        Team
   1      Andrea Bargnani -   Toronto Raptors 
  </code></pre>
  
  <p>I do:</p>
  
  <pre><code> num_rows = draftSheet.nrows - 1
   cur_row = -1
   while cur_row &lt; num_rows:
       cur_row += 1
       row = draftSheet.row(cur_row)
       if row[1] == player:
             ranking == row[0]
  </code></pre>
  
  <p>The problem is that the value of <code>row[1]</code> is <code>text:u'Andrea Bargnani</code>, as opposed to just <code>Andrea Bargnani</code>.</p>
  
  <p>I know that Excel, after Excel 97, is all unicode.  But even if I do <code>player = u'Andrea Bargnani'</code> there is still the preceding <code>text:</code>.  So I tried <code>player = 'text:'u'Andrea Bargnani'</code>, but when the variable is called it ends up looking like <code>u'text: Andrea Bargnani</code> and still does not produce a match.</p>
  
  <p>I would like to then just strip the <code>test: u'</code> off of the returned <code>row[1]</code> value in order to get an appropriate match.</p>