appends expr to a file.


appends a sequence of expressions expri to a file.

Details and Options

  • 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.
  • PutAppend works with cloud objects.
  • PutAppend[,File["file"]] is also supported.


open allclose all

Basic Examples  (1)

Append expression values at the end of a temporary file:

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

Put the value of x in a file:

Update x and append the new value to the file:

The file now contains the two values:

Append successive iterates to the file in a loop:

Reset to the original directory:

Scope  (1)

Append expression to the file specified by the File object:

Introduced in 1988
Updated in 2014