This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.

 1.11.1 Reading and Writing Mathematica Files You can use files on your computer system to store definitions and results from Mathematica. The most general approach is to store everything as plain text that is appropriate for input to Mathematica. With this approach, a version of Mathematica running on one computer system produces files that can be read by a version running on any computer system. In addition, such files can be manipulated by other standard programs, such as text editors. Reading and writing files. This expands , and outputs the result to a file called tmp. In[1]:= Expand[ (x + y)^3 ] >> tmp Here are the contents of tmp. They can be used directly as input for Mathematica. In[2]:= !!tmp "x^3 + 3*x^2*y + 3*x*y^2 + y^3" This reads in tmp, evaluating the Mathematica input it contains. In[3]:= <>, >>> and << as being analogous to the shell operators >, >> and <. The redirection operators >> and >>> are convenient for storing results you get from Mathematica. The function Save["name", f, g, ... ] allows you to save definitions for variables and functions. Saving definitions in plain text files. Here is a definition for a function f. In[4]:= f[x_] := x^2 + c This gives c the value 17. In[5]:= c = 17 Out[5]= This saves the definition of f in the file ftmp. In[6]:= Save["ftmp", f] Mathematica automatically saves both the actual definition of f, and the definition of c on which it depends. In[7]:= !!ftmp "f[x_] := x^2 + c c = 17" This clears the definitions of f and c. In[8]:= Clear[f, c] You can reinstate the definitions you saved simply by reading in the file ftmp. In[9]:= <