The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.lang.python
From: list-pyt...@ccraig.org (Christopher A. Craig)
Date: 26 Nov 2003 12:20:01 -0500
Local: Wed, Nov 26 2003 12:20 pm
Subject: Re: Extract double in binary file
pascal.par...@free.fr (Pascal) writes: You're sort of vague here, but I don't think struct is going to help > I've a binary file with data in it. > This file come from an old ms dos application (multilog ~ 1980). > In this application, a field is declared as a 'decimal' (999 999 > 999.99). > I put 0.00 in the field and save the record to the file. > When I look in the binary file (with python or an hex editor), the > field is stored on 8 bytes: 00-00-00-00-00-00-7F-00. > I try unpack from struct module but the result isn't good. > Can someone help me? you regardless. "decimal" in this case is almost certainly some sort of BCD, which isn't a standard C struct (and therefore unknown to the struct module). You really need to figure out how the data is stored. Based on your tstr='' With two major caveats: -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||