title: if row[0] in row[1] print row
body: <p>I have a csv file that has 2 columns. I am simply trying to figure if each <code>row[0]</code> value is in some <code>row[1]</code> and if so, to print <code>row</code>.</p>
  
  <p>Items in csv file:</p>
  
  <pre><code>COL1,   COL2
  1-A,    1-A
  1-B,    2-A
  2-A,    1-B
  2565,   2565
  51Bc,   51Bc
  5161,   56
  811,    65
  681,    11
  55,     3
  3,      55
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>import csv
  doc= csv.reader(open('file.csv','rb'))
  
  for row in doc:
      if row[0] in row[1]:
          print row[0]
  </code></pre>
  
  <p>The end result should be:</p>
  
  <pre><code>1-A
  1-B
  2-A
  2565
  51Bc
  55
  3
  </code></pre>
  
  <p>Instead, it is giving me:</p>
  
  <pre><code>1-A
  2565
  51Bc
  </code></pre>
  
  <p>It prints those numbers because they are right next to each other side by side but what I need it to do is get the first item in COL1 and see if it finds it in the entire COL2 list and print if it does. Not see if its beside each other and print it.</p>