I am parsing a large data file using:
reader = csv.DictReader(open('Sourcefile.txt','rt'), delimiter = '\t')
for row in reader:
etc
etc
Parsing works great but I am performing calculations on the data, which require me to directly access the line I'm on, the line before, or to skip 10 lines ahead.
I can't figure out how to get the actual line number of the file I am in, and how to move to some other line in the file (ex: "Current_Line" + 10) and start accessing data from that point forward in the file.
Is the solution to read the entire file into an array, rather than trying to move back and forth in the file? I am expecting this file to be upwards of 160MB and assumed moving back and forth in the file would be most memory efficient.