Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Reads in only part of file

  • To: mathgroup at
  • Subject: [mg51176] Re: Reads in only part of file
  • From: "Mariusz Jankowski" <mjankowski at>
  • Date: Thu, 7 Oct 2004 05:26:01 -0400 (EDT)
  • Organization: University of Southern Maine
  • References: <ck0c50$nvp$>
  • Sender: owner-wri-mathgroup at

Steve, use the option DOSTextFormat -> True. This an option of OpenStream so
you must do

stream = OpenStream[ st1, DOSTextFormat -> True]
xin = ReadList[stream, {Byte, Byte}]

Good luck, Mariusz

>>> Steve Gray<stevebg at> 10/6/2004 4:59:12 AM >>>
I have a binary file of 945 coordinates, in X,Y pairs, each value being 8
bits, for 1890
bytes total. I have examined the file with a hex file display and editor
(which shows the file as 2
hex characters per byte) and confirms that the file contains exactly the
expected number of bytes.
My input process is:

roswin[nv_]:=  Module[{st1}, 
         nverts = nv; 
         Print["Reading file: ",st1];

The file opens ok but the input list xin contains only 230 coordinate pairs
(byte pairs) instead of
945. The values that do read in are correct. The {Byte,Byte} seems to be the
only data type that
works here. Can anyone suggest what I am doing wrong? (Do I have to Close
st1?) Thank you for any

Steve Gray

  • Prev by Date: Re: solve and simplify. force left hand side to be 0==
  • Next by Date: Re: notation for integration limits
  • Previous by thread: Reads in only part of file
  • Next by thread: Re: Reads in only part of file