I need some help. I have four different files to which I would like to open and only read the files while skipping the headers for each individual file into a function. This is what I got so far but i'm not even sure how to move forward from here:
import csv
particle_counter = file('C:/Users/Desktop/Level 2 files/HiSAM1_data_160206_134230.csv','rU')
gas_csv = file('C:/Users/Desktop/Level 2 files/gas_0.csv','rU')
gps_csv = file('C:/Users/Desktop/Level 2 files/gps_0.csv','rU')
pm2_5_csv = file('C:/Users/Desktop/Level 2 files/pm25_0.csv','rU')
reader1 = csv.reader(particle_counter)
reader2 = csv.reader(gas_csv)
reader3 = csv.reader(gps_csv)
reader4 = csv.reader(pm2_5_csv)
def skipline(n,filename):
x =1
while x < n in filename:
return csv.reader.next(filename)
The whole idea is to reduce space in my coding so I can only use that one function to skip the header in each individual file and be able to print each file to test it out. Any help will do guys! Thanks! Note: please feel free if you feel like editing the question.