Importing of Files
- To: mathgroup at smc.vnet.net
- Subject: [mg5880] Importing of Files
- From: Mario Sancho Graca <M.S.Graca at Warwick.ac.uk>
- Date: Sun, 2 Feb 1997 01:31:55 -0500
- Organization: University of Warwick
- Sender: owner-wri-mathgroup at wolfram.com
To MathGroup Readers I have files captured with a charge-coupled device camera, consisting of 512*512=262144 pixels. I need to import them into Mathematica, which I can on a Unix workstation (Mathematica v 2.2). However I work with a PC (Windows 95, Mathematica 3.0), the files being transferred from the Unix machine through modem. For the example below, with the same reading commands Mathematica identifies an 'end-of-file' after reading 28556 elements (file transferred as ascii) or 12304 elements (file transferred as binary). There are many pixels still to read! Do you know what is happening? It seems that the problem is Unix and Windows handling files differently. Illustration: For the file 'q3a1_ascii' which is a file transferred as ascii. The following reads the first 100 points with no problem on Unix: inputStreamq3a1ascii = OpenRead["q3a1_ascii"] q3a1asciiRead={}; Do[ q3a1asciiReadRow={}; Do[ q3a1asciiReadRow= Append[q3a1asciiReadRow, Read[inputStreamq3a1ascii,Byte]]; ,{512}]; q3a1asciiRead=Append[q3a1asciiRead, q3a1asciiReadRow]; ,{100}] //Timing Close[inputStreamq3a1ascii] The same code under Windows reads EndOfFile at q3a1asciiRead[[56]][[397]]. Thanking in advance all MathGroup readers for the attention given. -- Mario Sancho Graca University of Warwick Department of Engineering Coventry CV4 7AL United Kingdom Email: M.S.Graca at Warwick.ac.uk