September 30th, 2005, 12:21 PM
Parsing Binary Files
I am trying to write a script which parses a binary file. The binary data represents a series of LARGE records. I only want to pluck out one item from each record. I was wondering if python had some built-in function to allow me to skip ahead to whatever byte I want to allow me to only read that byte. These records are quite big and there are potentially many thousand records I am dealing with which is why I do not simply want to just read in each record entirely. In "C" I can jump ahead so many bytes from the current file position, but I don't know how to do it in python.
September 30th, 2005, 12:36 PM
Forget it. I found it in the docs. Yes there is a seek
function to jump ahead for those of you wondering.