ODS - Maple Help

ODS file format

Description

 • ODS (OpenDocument Spreadsheet) is an XML-based spreadsheet file format used by OpenOffice.
 • The commands ImportMatrix and ExportMatrix can read and write to the ODS format.
 • The general-purpose commands Import and Export also support this format.
 • The default output from Import for this format is a DataSeries, the individual elements of which are DataFrames corresponding to worksheets within the ODS spreadsheet.

Notes

Examples

Import an ODS spreadsheet listing the highest mountain peaks in the world.

 > $\mathrm{Import}\left("example/HighestPeaks.ods",\mathrm{base}=\mathrm{datadir}\right)$
 $\left[\begin{array}{cc}{"Maple Data"}& \left[\begin{array}{cccc}{}& {\mathrm{Height \left(m\right)}}& {\mathrm{Location}}& {\mathrm{First ascent}}\\ {\mathrm{Mount Everest}}& {8848}& {"2759\text{'}17"N 8655\text{'}31"E"}& {1953}\\ {\mathrm{K2}}& {8611}& {"3552\text{'}53"N 7630\text{'}48"E"}& {1954}\\ {\mathrm{Kangchenjunga}}& {8586}& {"2742\text{'}12"N 8808\text{'}51"E"}& {1955}\\ {\mathrm{Lhotse}}& {8516}& {"2757\text{'}42"N 8655\text{'}59"E"}& {1956}\\ {\mathrm{Makalu}}& {8485}& {"2753\text{'}23"N 875\text{'}20"E"}& {1955}\\ {\mathrm{Cho Oyu}}& {8188}& {"2805\text{'}39"N 8639\text{'}39"E"}& {1954}\\ {\mathrm{Dhaulagiri I}}& {8167}& {"2841\text{'}48"N 8329\text{'}35"E"}& {1960}\\ {\mathrm{Manaslu}}& {8163}& {"2833\text{'}00"N 8433\text{'}35"E"}& {1956}\\ {\mathrm{Nanga Parbat}}& {8126}& {"3514\text{'}14"N 7435\text{'}21"E"}& {1953}\\ {\mathrm{Annapurna I}}& {8091}& {"2835\text{'}44"N 8349\text{'}13"E"}& {1950}\end{array}\right]\end{array}\right]$ (1)

Import the same data as above but returned as a table of Matrices.

 > $\mathrm{Import}\left("example/HighestPeaks.ods",\mathrm{base}=\mathrm{datadir},\mathrm{output}=\mathrm{table}\right)$
 ${table}{}\left(\left[{"Maple Data"}{=}\begin{array}{c}\left[\begin{array}{cccc}{"Name"}& {"Height \left(m\right)"}& {"Location"}& {"First ascent"}\\ {"Mount Everest"}& {8848}& {"2759\text{'}17"N 8655\text{'}31"E"}& {1953}\\ {"K2"}& {8611}& {"3552\text{'}53"N 7630\text{'}48"E"}& {1954}\\ {"Kangchenjunga"}& {8586}& {"2742\text{'}12"N 8808\text{'}51"E"}& {1955}\\ {"Lhotse"}& {8516}& {"2757\text{'}42"N 8655\text{'}59"E"}& {1956}\\ {"Makalu"}& {8485}& {"2753\text{'}23"N 875\text{'}20"E"}& {1955}\\ {"Cho Oyu"}& {8188}& {"2805\text{'}39"N 8639\text{'}39"E"}& {1954}\\ {"Dhaulagiri I"}& {8167}& {"2841\text{'}48"N 8329\text{'}35"E"}& {1960}\\ {"Manaslu"}& {8163}& {"2833\text{'}00"N 8433\text{'}35"E"}& {1956}\\ {"Nanga Parbat"}& {8126}& {"3514\text{'}14"N 7435\text{'}21"E"}& {1953}\\ {⋮}& {⋮}& {⋮}& {⋮}\end{array}\right]\\ \hfill {\text{11 × 4 Matrix}}\end{array}\right]\right)$ (2)

Export a random matrix to an ODS spreadsheet in the home directory of the current user.

 > $M≔\mathrm{LinearAlgebra}:-\mathrm{RandomMatrix}\left(100,2\right):$
 > $\mathrm{Export}\left("example.ods",M,\mathrm{base}=\mathrm{homedir}\right)$
 ${24639}$ (3)

Compatibility

 • With Maple 2016, the Import command applied to ODS files now produces DataSeries objects by default. To produce a table, use Import(...,output=table).