title: Search for substring in csv file row and print the row
body: <p>relatively new to python.</p>
  
  <p>I am trying to search for substring in a csv file row and manipulate the data. </p>
  
  <p><strong>CsvFile:</strong>
  Appname1,-l Licensename 1
  Appname2,-l Licensename 2
  Appname3,-l Licensename 3</p>
  
  <p>I have tried this:</p>
  
  <pre><code>def fun(args):
      appNames = args
      csv_file = csv.reader(open('AppNames.csv', "rb"), delimiter=",")
      for row in csv_file:
                  #if current rows 2nd value is equal to input, print that row
          if appNames == row[0]:
              print row
          else:
              print "no match found"
  </code></pre>
  
  <p><strong>Input</strong>: name1</p>
  
  <p><strong>Expectedoutput</strong>: Appname1,-l Licensename 1</p>
  
  <p><strong>Currentoutput</strong> : no match or getting error: "TypeError: expected str, bytearray or other buffer compatible object"</p>
  
  <p>However I cant find this still as it is a substring that I am providing. </p>
  
  <p>I tried </p>
  
  <pre><code>if appNames in row[1]:
  </code></pre>
  
  <p>But getting error: <em>"TypeError: expected str, bytearray or other buffer compatible object"</em></p>
  
  <p>Anyone has any better ideas how to search for it. </p>
  
  <p>Also I want to copy only the Licensename field to a variable after finding the app name. </p>