title: How to read hundreds of csv files from a directory and sum a specific column from each of them?
body: <p>I have around 650 csv files in a directory. Each of them have three columns with header(#ch# ##kev## ###count###), and 2050 rows.One of the file image is shown here partly. </p>
  
  <pre><code>    ch       kev     count
       0        0        0
       1        0        0
       2        0        0
       .        .        .
       .        .        .  
       .        .        .
      100       0        30
      101       0        70
       .        .        .
       .        .        .
      200       .        1000
      201       0        1037
       .        .        .
       .        .        .
      2050      0        0        
  </code></pre>
  
  <p>I would like to sum of column(###count###) for a specific range (100 -200) of value of column(#ch#). I am able to write the program only for a single csv file is show below: </p>
  
  <pre><code>    import csv
  
      cr = csv.reader(open("D:\\Pythontest\\test1.csv", 'r'))
      cr.next()
      ['ch', 'kev', 'count']
  
      total = 0
  
      for row in cr:
          if 100 &lt;= int(row[0]) &lt;= 200:
             total += int(row[2])
  
      print total
  </code></pre>
  
  <p>But I don't know how to write the program for all of the files at a time. I would like to extract sum value from each of the file and put them together in a separate file. I am using Python 2.7.</p>