Bug introduced in 9.0 and fixed in 9.0.1
I'm trying to load some data into Mathematica from some files generated by fortran. But ReadList seems can't get the number correct.
Here is a simplified version of the problem:
ReadList[StringToStream@" 0.000000000000000000E+00
0.490953850725349982E-10
0.135898165173686872E-09
0.264968686580858939E-09", Number]
(*{0.,4.9095385072534998*10^12709,1.3589816517368687*10^12708,2.6496868658085894*10^12708}*)
In the documentation, it promised that:
ReadList can handle numbers that are given in Fortran-like "E" notation. Thus, for example, ReadList will read 2.5E+5 as 2.5*10^5. Note that ReadList can handle numbers with any number of digits of precision.
Why ReadList can't read this correctly? Is this a bug?
Import
can get the numbers correct
Import[Export["/work/mwu3/temp/1234.dat", " 0.000000000000000000E+00
0.490953850725349982E-10
0.135898165173686872E-09
0.264968686580858939E-09"], "List"]
(*{0.,4.9095385072534998*10^-11,1.3589816517368687*10^-10,2.6496868658085894*10^-10}*)
but I have very large data files, Import
would take forever.
Is there a way to solve it?
Here is my system information:
Mathematica:
9.0 for Linux x86 (64-bit) (November 20, 2012), ReleaseID -> 9.0.0.0
os :
Linux version 2.6.32-358.6.2.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Tue May 14 15:48:21 EDT 2013