Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)


writes the expressions expri in sequence, followed by a newline, to the specified output channel.


  • The output channel used by Write can be a single file or pipe, or a list of them, each specified as a string "name", as File["name"], or as an OutputStream object.
  • Write is a low-level Wolfram Language output function. Functions like Print and Message are defined in terms of it.
  • If any of the specified files or pipes are not already open, Write calls OpenWrite to open them.
  • Write does not close files and pipes after it finishes writing to them.
  • By default, Write generates output in the form specified by the setting of the FormatType option for the output stream used.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Open a stream:

Click for copyable input

Write to the stream:

Click for copyable input

Close the stream:

Click for copyable input

Read the file:

Click for copyable input
Introduced in 1988
| Updated in 2016