#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    74
    Rep Power
    11

    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.

    Thanks.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    74
    Rep Power
    11

    Nevermind


    Forget it. I found it in the docs. Yes there is a seek
    function to jump ahead for those of you wondering.

IMN logo majestic logo threadwatch logo seochat tools logo