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)
WOLFRAM LANGUAGE IMPORT/EXPORT FORMAT
- Import and Export support ExpressionJSON.
- ExpressionJSON provides lossless round-tripping of Wolfram Language expressions to and from JSON.
- By default, Import and Export use the "JSON" format for files ending in .json, rather than the "ExpressionJSON" format.
- Import["file","ExpressionJSON"] imports a file that uses the ExpressionJSON format, producing an ordinary Wolfram Language expression.
- Export["file",expr,"ExpressionJSON"] exports an arbitrary expression to ExpressionJSON.
- Elements of expressions are represented as follows in ExpressionJSON:
"string" "'string'" (UTF-8, with JSON escaping) True, False true, false Null null symbol "symbol" f[e1,e2,…,opt1val1,…] ["f",e1,e2,…,["Rule",opt1,val1],…]
- Machine integers are represented literally. Larger integers are represented as "digits".
- Machine-precision numbers are represented as JSON numbers using e notation.
- Arbitrary-precision numbers are by default given as "number", where number is the InputForm representation of the number.
Import a String:
Import a Quantity:
Export a list while converting None to JSON null:
Introduced in 2016