title: Find atributes in a csv file python
body: <p>i have a file <code>atributes.csv</code> like this:</p>
  
  <pre><code>Ethnics   HairColor   EyeColor  HairStyle
  
  European     Red       Blue      Short
  European     Blonde    Dark      Short
  European     Brown     Green     Long
  Asian        Brown     Dark      Medium
  </code></pre>
  
  <p>and another <code>db.csv</code> like this:</p>
  
  <pre><code>Name   Id  Ethnics  HairColor  HairStyle  EyeColor
  
  Ana    11  European   Red      Short      Blue
  Ion     8  European   Brown    Short      Dark
  Ryan   24  Asian      Brown    Short      Blue
  Mike   13  European   Brown    Short      Blue
  Paul    9  European   Blonde   Short      Dark
  Sam     1  European   Brown    Short      Green
  John    4  European   Blonde   Long       Green
  Chung   6  Asian      Brown    Medium     Dark
  </code></pre>
  
  <p>i would like to write into antoher csv file <code>final.csv</code> lines which contains atributes from <code>atributes.csv</code> for example</p>
  
  <pre><code>Ana    11  European   Red      Short      Blue
  Paul    9  European   Blonde   Short      Dark
  Chung   6  Asian      Brown    Medium     Dark
  </code></pre>
  
  <p>i write this code but didnt`t work</p>
  
  <pre><code>import csv
  import os
  
  f = open('atributes.csv', 'r')
  reader = csv.reader(f)
  next(reader)
  f1 = open('db.csv', 'r')
  reader1 = csv.reader(f1, delimiter=',')
  next(reader1)
  
  ofile = open('final.csv', 'w')
  writer = csv.writer(ofile)
  for line1 in reader :
          for line2 in reader1 :
                          if line1[0]== line2[2] and line1[1]== line2[3] and line1[2]== line2[5] and line1[3]== line2[4]:
                                  writer.writerow(line2)
  
  f.close()
  f1.close()
  ofile.close()
  </code></pre>