Export - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Input and Output : Export

Export

export data from Maple to a file

 

Calling Sequence

Parameters

Options

Description

Supported Formats

Examples

Compatibility

Calling Sequence

Export(dest, data, opts)

Export(data, target=direct, opts)

Parameters

dest

-

string; file path or URL of the data file

data

-

data to be exported

opts

-

(optional) the format options as described later

Options

• 

format : string

  

The format option specifies the export format to use. This must correspond to one of the supported export formats. If omitted, the export format is inferred from the file extension of dest.

• 

target : one of file or direct

  

The default target=file specifies that the data should be written to the file referenced by dest; target=direct means that the data will be exported to a string or ByteArray to be returned. Note that target=direct requires format to be provided explicitly.

• 

base : one of bindir, currentdir, datadir, homedir, mapledir, tempdir, toolboxdir, or worksheetdir.

  

The base option specifies a base directory. Any local file specified with dest will be interpreted as a relative path under this directory. For the meaning of each of these values, see kernelopts or interface.

Description

• 

The Export command exports data from Maple to an external file or to a string or ByteArray in the specified file format.

• 

When target=file (the default), the command writes the exported data to the file dest and returns a number showing the count of bytes written.

• 

When target=direct, the data is exported to a string or ByteArray which is returned as output. Note that target=direct requires format to be provided explicitly.

• 

For details about the types of input accepted by a particular output format, consult the documentation for that format.

Supported Formats

BMP

BYU

CNF

CSV

DGML

DIF

Digraph6

DIMACS

DOT

DXF

FASTA

FASTQ

GenBank

GEXF

GIF

Graph6

Graphlet

GraphML

GXL

GZIP

INI

JGF

JPEG

JSON

JVX

LEDA

MathML

MAT

MatrixMarket

MetaPost

MLA

MPL

MW

OBJ

ODS

OFF

Pajek

PLY

SMTLIB

Sparse6

STL

SXC

Text

TGF

TSV

Text

VTK

WMF

XLS

XLSX

XML

YAML

ZIP

ZLIB

Examples

Export a plot to a JPEG file.

Exportsinefile.jpg,plotsin,base=homedir

24610

(1)

Export numeric data to a file in Comma-Separated Values (CSV) format.

Exportdata.csv,LinearAlgebra:-RandomMatrix50,2,base=homedir

334

(2)

Export data directly to a string in the JSON format with target=direct.

PersonDataRecordsurname=Turing,firstname=Alan,birth=1912-06-23,death=1954-06-07

PersonDataRecordsurname=Turing,firstname=Alan,birth=1912-06-23,death=1954-06-07

(3)

ExportPersonData,format=JSON,target=direct

{"surname": "Turing", "firstname": "Alan", "birth": "1912-06-23", "death": "1954-06-07"}

(4)

Export the same data to a JSON file.

Exportturing.json,PersonData,base=homedir

88

(5)

Compatibility

• 

The Export command was introduced in Maple 2015.

• 

For more information on Maple 2015 changes, see Updates in Maple 2015.

• 

The Export command was updated in Maple 2017.

• 

The base option was introduced in Maple 2017.

• 

For more information on Maple 2017 changes, see Updates in Maple 2017.

See Also

ExportMatrix

Formats

Formats,All

Import

plottools[exportplot]