Good point. Hadn't thouhgt of that.
Thanks
Grant
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> what concerns me though is that although the file is opened in binary
> mode,
> "for line.." has a problem reading the file correctly.
There is _no_ correct way of splitting a file containing binary data in
lines because binary data may contain newline bytes that do not
Hi ,
Thanks for the tip regarding checking the length of line. I discovered
that on the problem record it was short by a few bytes. After changing
the read method from "for line in.." to "infile.read(n)" my problem was
solved,
what concerns me though is that although the file is opened in binary
m
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> except when line[86:90] contains "carriage-return" "linefeed"
> which are valid binary packed values.
You probably don't want to be reading binary data a
line at a time, if that's what you're doing.
--
http://mail.python.org/mailma
[EMAIL PROTECTED] wrote:
> I am pretty new to python and am having a problem
> intepreting binary data using struct.unpack.
> I am reading a file containing binary packed data
> using open with "rb". All the values are coming through
> fine when using (integer1,) = struct.unpack('l', line[86:90])
Hi All,
I am pretty new to python and am having a problem
intepreting binary data using struct.unpack.
I am reading a file containing binary packed data
using open with "rb". All the values are coming through
fine when using (integer1,) = struct.unpack('l', line[86:90])
except when line[86:90] con