I have a csv file deliminated by ,.
The first line contains the report name, the second line contains the report data.
The headers are in line 3 and all the other rows are data.
How do I use the csv module to read the headers from line 3 instead of 1?
Below is what I have now.
import csv
f = open ("myfile.csv", "rb")
reader = csv.reader(f, delimiter=",")
headers = reader.next()
reader.next()ornext(reader)3 times!csvmodule doesn't check that all rows are the same, so you can just callnext()to consume them and throw them away.csv.readerobject. The current position of the file doesn't have to at its very beginning when you do this.