       Re: Creating and Opening Files on a Mac...

• To: mathgroup at smc.vnet.net
• Subject: [mg3684] Re: Creating and Opening Files on a Mac...
• From: ianc (Ian Collier)
• Date: Fri, 5 Apr 1996 02:53:28 -0500
• Organization: Wolfram Research, Inc.
• Sender: owner-wri-mathgroup at wolfram.com

```In article <4jd5st\$pmr at dragonfly.wolfram.com>, gfs5729 at tam2000.tamu.edu
(Bob-God of Ohio) wrote:

>         Hi!  What command in Mathematica can I use to create a text file
> consisting of the output of a calculation on a mac?  I thought Splice[] was
> the command to use, but I couldn't figure it out...
>
>                                         Thanks,
>                                         George Simler
>
> --
> IV future president of the world

You can simply use Put and Get.

here is a simple example:

In:=
expr = Expand[ (a+b)^3]
Out=
3      2          2    3
a  + 3 a  b + 3 a b  + b

In:=
expr >> expr.txt

In:=
!!expr.txt
a^3 + 3*a^2*b + 3*a*b^2 + b^3

In:=
expr2 = <<expr.txt
Out=
3      2          2    3
a  + 3 a  b + 3 a b  + b

In:=
Factor[ expr2 ]
Out=
3
(a + b)

If you want to append an expression to your file you can do so
with >>> (Append).

I hope this helps.

--Ian

-----------------------------------------------------------
Ian Collier
Wolfram Research, Inc.
-----------------------------------------------------------
tel:(217)-398-0700   fax:(217)-398-0747    ianc at wolfram.com