MathGroup Archive 2001

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

Search the Archive

Re: Export table problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg30931] Re: [mg30891] Export table problem
  • From: Tomas Garza <tgarza01 at prodigy.net.mx>
  • Date: Thu, 27 Sep 2001 02:16:48 -0400 (EDT)
  • References: <200109230616.CAA22636@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

I tried your problem under both Versions 4.0 and 4.1 and could not replicate
the situation you report. I used the same two lines that follow:

In[1]:=
x = Round[100*Table[{i, i/5, i/3}, {i, 1, 20}]]/100.
Out[1]=
{{1., 0.2, 0.33}, {2., 0.4, 0.67}, {3., 0.6, 1.}, {4., 0.8, 1.33}, {5., 1.,
    1.67}, {6., 1.2, 2.}, {7., 1.4, 2.33}, {8., 1.6, 2.67}, {9., 1.8,
    3.}, {10., 2., 3.33}, {11., 2.2, 3.67}, {12., 2.4, 4.}, {13., 2.6,
    4.33}, {14., 2.8, 4.67}, {15., 3., 5.}, {16., 3.2, 5.33}, {17., 3.4,
    5.67}, {18., 3.6, 6.}, {19., 3.8, 6.33}, {20., 4., 6.67}}
In[2]:=
Export["table.txt", x, "Table"]
Out[2]=
"table.txt"

Of course the results appear in the corresponding directories Math4.0 and
Math4.1, respectively. Still, opening in Excel File|Open|..... yields in
both cases the 20 x 3 table|

 1 0.2 0.33
2 0.4 0.67
3 0.6 1
4 0.8 1.33
5 1 1.67
6 1.2 2
7 1.4 2.33
8 1.6 2.67
9 1.8 3
10 2 3.33
11 2.2 3.67
12 2.4 4
13 2.6 4.33
14 2.8 4.67
15 3 5
16 3.2 5.33
17 3.4 5.67
18 3.6 6
19 3.8 6.33
20 4 6.67

Tomas Garza
Mexico City

----- Original Message -----
From: <maarten.vanderburgt at icos.be>
To: mathgroup at smc.vnet.net
Subject: [mg30931] [mg30891] Export table problem


> Hallo,
>
> Below I generate a table of numbers, which I round to get numbers with 2
> decimals precision. I want to export them in a ascii file. In my output
> file I get some numbers like  1.4000000000000001 instead of simply 1.4.
> Where does this extra  0.0000000000000001 come from? Is this a bug? How
can
> I get rid of it without editing my file.?
>
> Thanks for your help
>
> Maarten van der Burgt
> Belgium
>
> Round[100*Table[{i,i/5,i/3},{i,1,20}]]/100.;
> Export["c:\\temp\\table.txt",%,"Table"]
>
> When I open  table.txt I see:
> 1.    0.2                  0.33
> 2.    0.4                  0.67
> 3.    0.6                  1.
> 4.    0.8                  1.33
> 5.    1.                   1.67
> 6.    1.2                  2.
> 7.    1.4000000000000001   2.33
> 8.    1.6                  2.67
> 9.    1.8                  3.
> 10.   2.                   3.33
> 11.   2.2                  3.67
> 12.   2.4                  4.
> 13.   2.6                  4.33
> 14.   2.8000000000000003   4.67
> 15.   3.                   5.
> 16.   3.2                  5.33
> 17.   3.4                  5.67
> 18.   3.6                  6.
> 19.   3.8000000000000003   6.33
> 20.   4.                   6.67
>
>



  • Prev by Date: Re: ReadList, mix Words & Numbers?
  • Next by Date: Re: Q: Solving econometric models
  • Previous by thread: Export table problem
  • Next by thread: Re: Export table problem