WDX (.wdx)

Mathematica WDX data format.
Used by the Mathematica system for storing and exchanging expressions and data.
WDX is an acronym derived from Wolfram Data Exchange.
Binary format.
Stores arbitrary Mathematica expressions in a serialized, platform-independent form.
Developed in 2007 by Wolfram Research.

Import and ExportImport and Export

  • Import["file.wdx"] reads in a Mathematica package, evaluating each expression in it, and returning the last one.
  • Export["file.wdx", expr] exports a single expression to a Mathematica source file.
  • Import["file.wdx", elem] imports the specified element from a Mathematica source file.
  • Import["file.wdx", {elem, suba, subb, ...}] imports a subelement.
  • Import["file.wdx", {{elem1, elem2, ...}}] imports multiple elements.
  • The import format can be specified with Import["file", "WDX"] or Import["file", {"WDX", elem, ...}].
  • Import["file.wdx"] is equivalent to Get["file.wdx"].
  • Export["file.wdx", expr, elem] creates a Mathematica source file by treating expr as specifying element elem.
  • Export["file.wdx", {expr1, expr2, ...}, {{elem1, elem2, ...}}] treats each as specifying the corresponding .
  • Export["file.wdx", expr, opt1->val1, ...] exports expr with the specified option elements taken to have the specified values.
  • Export["file.wdx", {elem1->expr1, elem2->expr2, ...}, "Rules"] uses rules to specify the elements to be exported.
  • Put[expr1, expr2, ..., "file.wdx"] can be used to export multiple expressions.
  • See the reference pages for full general information on Import and Export.
  • ImportString and ExportString support the WDX format.

ElementsElements

  • General Import elements:
  • "Elements"list of elements and options available in this file
    "Rules"full list of rules for each element and option
    "Options"list of rules for options, properties, and settings
  • Data representation element:
  • "Expression"reads and evaluates the expression stored in the file
  • Import by default uses the element for Mathematica WDX files.
  • Meta-information element:
  • "Version"file format version number

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

This converts an arbitrary expression to a string in WDX format:

In[1]:=
Click for copyable input
Out[1]=

This converts the WDX string back to an expression:

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