On 9/5/07, Francesco Guerrieri <[EMAIL PROTECTED]> wrote: > On 9/5/07, planetmatt <[EMAIL PROTECTED]> wrote: > > I am a Python beginner. I am trying to loop through a CSV file which > > I can do. What I want to change though is for the loop to start at > > row 2 in the file thus excluding column headers. > > > > At present I am using this statement to initiate a loop though the > > records: > > > > for line in f.readlines(): > > > > How do I start this at row 2? > > > > you can simply call (and maybe throw away) f.readline() a single time before > looping. > If the lenght of the first line is fixed, you can also use f.seek to start > reading from the second row. > > francesco
Btw, if you are trying to read a csv file and parse it, you can save some work .. have a look at "csv" module ! -- ---- Amit Khemka website: www.onyomo.com wap-site: www.owap.in -- http://mail.python.org/mailman/listinfo/python-list