This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)
Export["file.ext", expr]
exports data to a file, converting it to the format corresponding to the file extension ext.
Export[file, expr, "format"]
exports data in the specified format.
Export[file, exprs, elems]
exports data by treating exprs as elements specified by elems.
  • Export["file.ext", expr] attempts to render expr in the appropriate format for the file. Among the possible forms for expr is normally the form that would be obtained from Import["file.ext"].
  • There are four common types of element specifications:
data representation specifications (e.g. "RawData", "Graphics")
format specifications (e.g. "GIF", "GZIP", "XLS")
options, properties and settings (e.g. ImageSize, SampleRate)
metadata information (e.g. "Comments")
  • In Export[file, exprs, elems] the elements can have the following basic forms:
"format"use the default element for the specified format
elemexport a single element assuming the default format
{"format",elem}export an element assuming the specified format
{"comp1",...,"format",...}use also compression formats "compi" (e.g. "GZIP")
{elem1,{elem11,elem12,...}}export the expri as subelements elem1i of elem1
  • Forms of elements often supported include:
"Data"give data in a generic form (list, string, etc.)
"Graphics"give graphics or geometry as a Graphics object
"Graphics3D"give 3D graphics or geometry as a Graphics3D object
"Sound"give sound as a Sound object
"Grid"give a grid of data as a list or a Grid, etc.
"Rules"give explicit rules for elements to export
  • With the "Rules" element specification, the rules in exprs can have the following basic forms:
elemvala value for a single element
{elem1val1,elem2val2,...}values for several elements
elem1→{elem11val11,...}values for subelements
  • Export["!prog", expr, ...] exports data to a pipe.
  • Many options can be given using Export[file, exprs, elems, opts].
  • The names of options specific to particular formats and elements are normally strings.
New in 4 | Last modified in 6