title: "Line contains NULL byte" in CSV reader (Python)
body: <p>I'm trying to write a program that looks at a .CSV file (input.csv) and rewrites only the rows that begin with a certain element (corrected.csv), as listed in a text file (output.txt).</p>
  
  <p>This is what my program looks like right now:</p>
  
  <pre><code>import csv
  
  lines = []
  with open('output.txt','r') as f:
      for line in f.readlines():
          lines.append(line[:-1])
  
  with open('corrected.csv','w') as correct:
      writer = csv.writer(correct, dialect = 'excel')
      with open('input.csv', 'r') as mycsv:
          reader = csv.reader(mycsv)
          for row in reader:
              if row[0] not in lines:
                  writer.writerow(row)
  </code></pre>
  
  <p>Unfortunately, I keep getting this error, and I have no clue what it's about.</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Python32\Sample Program\csvParser.py", line 12, in &lt;module&gt;
      for row in reader:
  _csv.Error: line contains NULL byte
  </code></pre>
  
  <p>Credit to all the people <a href="https://stackoverflow.com/questions/7853606/whats-wrong-with-this-python-program-working-on-csv/7853688#7853688">here</a> to even to get me to this point.</p>