title: How to read certain rows of a csv file to another csv file in Python
body: <p>I am new here and also in Python scripting but i need some help about my litle script. I have a <code>CSV</code> file like this:</p>
  
  <pre><code>19928;renet;54;amsterdam
  
  27732;tango;36'rotterdam
  </code></pre>
  
  <p>enz. enz</p>
  
  <p>How can a select only the rows with amsterdam for writing in the new file?</p>
  
  <p>This is my script:</p>
  
  <pre><code>import csv
  import os
  
  data = [] #Buffer list 
  with open(os.path.join("CSV", "verliezen.csv"), "rb") as input_file:
      reader = csv.reader(input_file, delimiter=";")
      for row in reader:
          try:
              new_row = [row[0], row[3]]
              data.append(new_row)
  
          except IndexError as e:
              print e
              pass
  
          with open("the_new_csv.csv", "w+") as to_file:
              writer = csv.writer(to_file, delimiter=";")
              for new_row in data:
                  writer.writerow(new_row)
  </code></pre>