PutAppend


appends expr to a file.

PutAppend[expr1, expr2, ..., "filename"]
appends a sequence of expressions to a file.

DetailsDetails

  • PutAppend works the same as Put, except that it adds output to the end of the file, rather than replacing the complete contents of the file.

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

Append expression values at the end of a temporary file:

In[1]:=
Click for copyable input

Create a directory for temporary files and change to that directory:

In[2]:=
Click for copyable input

Put the value of in a file:

In[3]:=
Click for copyable input

Update and append the new value to the file:

In[4]:=
Click for copyable input

The file now contains the two values:

Append successive iterates to the file in a loop:

In[6]:=
Click for copyable input

Reset to the original directory:

In[8]:=
Click for copyable input
New in 1
New to Mathematica? Find your learning path »
Have a question? Ask support »