MathGroup Archive 2002

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

Search the Archive

Re: How to read in the output of another nb file?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg33079] Re: [mg33043] How to read in the output of another nb file?
  • From: Tomas Garza <tgarza01 at prodigy.net.mx>
  • Date: Fri, 1 Mar 2002 06:51:36 -0500 (EST)
  • References: <200202270548.AAA18128@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

If you want to save an expression or a variable into a file, perhaps it is
better to use Put (>>) and Get (<<) instead of Save:

In[1]:=
result = Table[Random[Integer, {0, 9}], {100}]
Out[1]=
{9, 1, 1, 5, 4, 3, 4, 4, 5, 2, 6, 0, 3, 2, 9, 6, 8, 1, 5,
  9, 9, 2, 4, 8, 7, 0, 9, 5, 9, 1, 6, 1, 7, 8, 7, 8, 3, 5,
  2, 2, 3, 3, 7, 4, 8, 7, 3, 3, 1, 5, 1, 5, 6, 0, 9, 4, 5,
  3, 2, 5, 0, 5, 2, 2, 4, 5, 1, 9, 8, 0, 9, 4, 7, 4, 1, 8,
  9, 9, 8, 9, 9, 0, 3, 2, 8, 4, 7, 6, 0, 7, 7, 9, 6, 0, 9,
  2, 3, 3, 9, 5}

In[2]:=
result >> "savedresult";

In[3]:=
<< "savedresult"
Out[3]=
{9, 1, 1, 5, 4, 3, 4, 4, 5, 2, 6, 0, 3, 2, 9, 6, 8, 1, 5,
  9, 9, 2, 4, 8, 7, 0, 9, 5, 9, 1, 6, 1, 7, 8, 7, 8, 3, 5,
  2, 2, 3, 3, 7, 4, 8, 7, 3, 3, 1, 5, 1, 5, 6, 0, 9, 4, 5,
  3, 2, 5, 0, 5, 2, 2, 4, 5, 1, 9, 8, 0, 9, 4, 7, 4, 1, 8,
  9, 9, 8, 9, 9, 0, 3, 2, 8, 4, 7, 6, 0, 7, 7, 9, 6, 0, 9,
  2, 3, 3, 9, 5}

Then you may assign a name to what you just read, like for example

In[5]:=
retrievedfile = %;

Tomas Garza
Mexico City
----- Original Message -----
From: "Qiang Liu" <liuqiang at hcms.hit.edu.cn>
To: mathgroup at smc.vnet.net
Subject: [mg33079] [mg33043] How to read in the output of another nb file?


> sorry my question maybe too easy.:-)
> I can use Save[] to store an expression or a variable into a file,
> and use !!filename to display the restored results in a new nb file.
> But they are only be displayed and not read into memory indeed.
> My question is how to read the results of another nb file into memory
> so that I can use it as a local variables.
>



  • Prev by Date: implementing linear operators
  • Next by Date: Re: which book is good to learn the programming in Mathematica?
  • Previous by thread: Re: How to read in the output of another nb file?
  • Next by thread: Finding pattern Mached series