[Tutor] regular expressions question
alan.gauld at freenet.co.uk
Sat Aug 12 11:33:32 CEST 2006
> The file's encoding is binary or something
> Here is the first section of the file:
> Does that tell you anything?
Recall that on a 32 bit computer each "word" is 4 bytes long
so to get anyting meaningful you often need to consider 4 byte
The next bit is tricky, either 'z' or
Now whether those numbers mean anything to you is a moot
point but thats usually the starting point.
> I have been trying to replace the pesky \x00's with something less
But that is almost certainly the wrong approach, you'll never
figure out where the word boundaries are without them!
> Suggestions greatly appreciated!!
Go look on the Konqueror site (at the code if necessary) to find the
format of the data structure in the file and use the struct module
to unpack it.
You might find the section in my tutorial (under Handling Files)
on binary files and using struct useful
Author of the Learn to Program web site
More information about the Tutor