I'm in the middle of a very large text file (nowhere near the EOF) opened like so:
iFile = open('big.csv', 'rb')
The good thing is that each line of data has the same length. So, moving FORWARD through the file is simply a multiple of that line length in bytes.
I need to avoid having to move to the beginning of the file, then traversing the data to where I was, only a few lines above the previous processing point.
I only see two options:
- utilize a iFile.seek(-425 * 8, 1) call, which will apparently NOT work in Python 3... (it throws a "io.UnsupportedOperation: can't do nonzero cur-relative seeks" error)
OR
- perform a seek(0), then perform a seek() to the location where I want to be.
Is there a third alternative that I'm not considering?
Thanks in advance for any insight... I'm stumped.