SXC - Maple Help

Sun XML Calc (.sxc) File Format

SXC file format

Description

 • SXC (Sun XML Calc) is an XML-based spreadsheet file format used by OpenOffice and StarOffice.
 • The commands ImportMatrix and ExportMatrix can read and write to the SXC 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 SXC spreadsheet.

Notes

 • Content-Type: application/vnd.sun.xml.calc

Examples

Import an ODS spreadsheet with demographic data on Central America.

 > $\mathrm{Import}\left("example/CentralAmerica.sxc",\mathrm{base}=\mathrm{datadir}\right)$
 $\left[\begin{array}{cc}{"Maple Data"}& \left[\begin{array}{cccc}{}& {\mathrm{Area \left(km^2\right)}}& {\mathrm{Capital}}& {\mathrm{Capital Location}}\\ {\mathrm{Belize}}& {22966.0}& {"Belmopan"}& {"1715\text{'}N 8846\text{'}W"}\\ {\mathrm{Costa Rica}}& {51100.0}& {"San Jos"}& {"956\text{'}N 845\text{'}W"}\\ {\mathrm{El Salvador}}& {21044.8}& {"San Salvador"}& {"1340\text{'}N 8910\text{'}W"}\\ {\mathrm{Guatemala}}& {108889.0}& {"Guatemala City"}& {"1438\text{'}N 9030\text{'}W"}\\ {\mathrm{Honduras}}& {112492.0}& {"Tegucigalpa"}& {"146\text{'}N 8713\text{'}W"}\\ {\mathrm{Nicaragua}}& {130375.0}& {"Managua"}& {"129\text{'}N 8616\text{'}W"}\end{array}\right]\end{array}\right]$ (1)

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

 > $\mathrm{Import}\left("example/CentralAmerica.sxc",\mathrm{base}=\mathrm{datadir},\mathrm{output}=\mathrm{table}\right)$
 ${table}{}\left(\left[{"Maple Data"}{=}\left[\begin{array}{cccc}{"Country"}& {"Area \left(km^2\right)"}& {"Capital"}& {"Capital Location"}\\ {"Belize"}& {22966.0}& {"Belmopan"}& {"1715\text{'}N 8846\text{'}W"}\\ {"Costa Rica"}& {51100.0}& {"San Jos"}& {"956\text{'}N 845\text{'}W"}\\ {"El Salvador"}& {21044.8}& {"San Salvador"}& {"1340\text{'}N 8910\text{'}W"}\\ {"Guatemala"}& {108889.0}& {"Guatemala City"}& {"1438\text{'}N 9030\text{'}W"}\\ {"Honduras"}& {112492.0}& {"Tegucigalpa"}& {"146\text{'}N 8713\text{'}W"}\\ {"Nicaragua"}& {130375.0}& {"Managua"}& {"129\text{'}N 8616\text{'}W"}\end{array}\right]\right]\right)$ (2)

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

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

Compatibility

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