Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.



Problem with ReadList[]
Posted:
Nov 9, 1996 2:00 AM


When reading in data from a file like this;
data=ReadList["data",Table[Byte,{100}]];
to create a 100x100 array (from a 10000 byte long file), I find that if Mathematica encounters the value 26 (0x1A) it chokes and treats the value 26 and all values after it as 'End of File' . Also there is a problem in that it seems to sometimes add bytes that do not exist in the file. For instance once this happened: I loaded a file and did
?data
I got back
104 98 29 53 5 53 90 97 5 57 27
When I looked directly (hex editor) at the data, the first row of bytes was
104 98 29 53 90 97 5 57 27
Very strange!
For some reason, Mathematica added the values 5 and 53. I imagine that there is some sort of character translation going on but I cannot find anything about it in the documentation or on the Wolfram Research website. Also it would seem strange that it would be doing some sort of character translation, but who knows? I am running Mathhematica 2.2.1 for Students on Windows 95 (4.00.950). I do not encounter this problem on Solaris.
Can anyone help? Is there a FAQ?
Andy Musk



