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 corresponding to one of the supported export formats; if unspecified, then the 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.

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.

• 

The target option may be set to file or direct. The default target=file specifies that the data should be written to the file referenced by dest. In contrast target=direct specifies that the data will be 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

DIMACS

DOT

DXF

Excel

FASTA

FASTQ

GenBank

GEXF

GIF

Graph6

Graphlet

GraphML

GXL

GZIP

INI

JPEG

JSON

JVX

LEDA

MathML

MAT

MatrixMarket

MetaPost

MLA

MPL

MW

OBJ

ODS

OFF

Pajek

PLY

Sparse6

STL

SXC

Text

TGF

TSV

Text

VTK

WMF

XML

ZIP

ZLIB

 

 

 

 

 

Examples

Export a plot to a JPEG file.

sinefileFileTools:-JoinPathsineplot.jpg,base=homedir

/Users/JohnSmith/sineplot.jpg

(1)

Exportsinefile,plotsin

24610

(2)

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

csvfileFileTools:-JoinPathdata.csv,base=homedir

/Users/JohnSmith/data.csv

(3)

Exportcsvfile,LinearAlgebra:-RandomMatrix50,2

334

(4)

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

(5)

ExportPersonData,format=JSON,target=direct

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

(6)

Export the same data to a JSON file.

jsonfileFileTools:-JoinPathturing.json,base=homedir

/Users/JohnSmith/turing.json

(7)

Exportjsonfile,PersonData

88

(8)

Compatibility

• 

The Export command was introduced in Maple 2015.

• 

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

See Also

ExportMatrix

Formats

Formats,All

Import

plottools[exportplot]