title: Remove a specific row in a csv file with python
body: <p>I am trying to remove a row from a csv file if the 2nd column matches a string. My csv file has the following information:</p>
  
  <pre><code>    Name
  15  Dog
  </code></pre>
  
  <p>I want the row with "Name" in it removed. The code I am using is:</p>
  
  <pre><code>import csv
  
  reader = csv.reader(open("info.csv", "rb"), delimiter=',')
  
  f = csv.writer(open("final.csv", "wb"))
  for line in reader:
      if "Name" not in line:
          f.writerow(line)
          print line
  </code></pre>
  
  <p>But the "Name" row isn't removed. What am I doing wrong?</p>
  
  <p>EDIT: I was using the wrong delimiter. Changing it to \t worked. Below is the code that works now.
      import csv</p>
  
  <pre><code>reader = csv.reader(open("info.csv", "rb"), delimiter='\t')
  
  f = csv.writer(open("final.csv", "wb"))
  for line in reader:
      if "Name" not in line:
          f.writerow(line)
          print line
  </code></pre>