SXC (.sxc)
- Import fully supports the SXC format.
Background & Context
-
- MIME type: application/nd.sun.xml.calc
- OpenOffice 1.0 spreadsheet file.
- Stores spreadsheet data and formulas.
- SXC is an acronym for Sun XML Calc.
- Native spreadsheet format of OpenOffice.org 1.0 and StarOffice 6.0.
- ZIP-compressed XML format.
- Supports multiple sheets in one file.
Import
- Import["file.sxc"] imports all sheets of an SXC file, returning the result as a list of arrays.
- Import["file.sxc"] returns the sheets of an SXC file as an expression of the form {s1,s2,…}, where the si are full arrays containing numerical and textual data, Boolean values, and date specifications.
- Import["file.sxc",elem] imports the specified element from an SXC file.
- Import["file.sxc",{elem,suba,subb,…}] imports a subelement.
- Import["file.sxc",{{elem1,elem2,…}}] imports multiple elements.
- The import format can be specified with Import["file","SXC"] or Import["file",{"SXC",elem,…}].
- See the following reference pages for full general information:
-
Import import from a file CloudImport import from a cloud object ImportString import from a string ImportByteArray import from a byte array
Import Elements
- General Import elements:
-
"Elements" list of elements and options available in this file "Summary" summary of the file "Rules" list of rules for all available elements - Basic information element:
-
"Dimensions" association of sheet names and sheet dimensions "SheetCount" number of sheets "Sheets" list of sheet names - Data representation elements:
-
"Data" list of full arrays, representing all sheets "EventSeries" table data as an EventSeries "Formulas" all SXC formulas as text "Tabular" list of Tabular objects, representing all sheets "TabularAssociation" association of sheet names and Tabular objects "TimeSeries" table data as a TimeSeries - Import by default uses the "Data" element.
- SXC data is represented in the Wolfram Language by real or integer numbers, strings, Boolean values True and False, and DateList specifications.
- SXC error cells are imported as $Failed.
- Import["file.sxc","Formulas"] gives spreadsheet formulas for each cell in the form {f1,f2,…}, where the fi are arrays corresponding to the sheets of an SXC file.
- Importing parts of a data sheet:
-
"Data",k the k
sheet, given as an array"Data",k,m row m of the k
sheet"Data",k,m,n cell {m,n} of the k
sheet - Import["file.sxc", {"Data",1}]returns the first sheet as an array.
- The following can be used to select or specify individual sheets by name:
-
"Sheets",name sheet name as an array "Sheets",name,m row m of sheet name "Sheets",name,m,n cell {m,n} in sheet name - Import["file.sxc",{"Sheets",All}] is equivalent to Import["file.sxc","Data"].
- Import yields spreadsheets as full rectangular arrays.
Options
- Import option:
-
"EmptyField" "" how empty cells are represented in the Wolfram Language "HeaderLines" Automatic number of lines to assume as headers "SkipLines" Automatic number of lines to skip at the beginning of the file "TimeColumn" Automatic column to use for times in "EventSeries" and "TimeSeries" elements
Examples
open all close allBasic Examples (2)
Scope (1)
Import Elements (10)
"Data" (4)
Import an SXC file as a list of values:
Import["ExampleData/mountains.sxc", "Data"]This is also the default element:
Import["ExampleData/mountains.sxc"]Import["ExampleData/mountains.sxc", {"Data", 1}]Import["ExampleData/mountains.sxc", {"Data", 1, 2}]Import["ExampleData/mountains.sxc", {"Data", 1, All, 2}]"EventSeries" (1)
Import the first sheet of an SXC file as an EventSeries:
Import["ExampleData/mountains.sxc", {"EventSeries", 1}]"Sheets" (1)
"Tabular" (2)
"TabularAssociation" (1)
Import all sheets as an association of sheet names and Tabular objects:
Import["ExampleData/mountains.sxc", "TabularAssociation"]"TimeSeries" (1)
Import the first sheet of an SXC file as a TimeSeries:
Import["ExampleData/mountains.sxc", {"TimeSeries", 1}]Import Options (3)
"HeaderLines" (1)
The header line is automatically detected by default:
Import["ExampleData/mountains.sxc", {"Tabular", 2}]Use "HeaderLines" option when automatic header detection is incorrect:
Import["ExampleData/mountains.sxc", {"Tabular", 2}, "HeaderLines" -> 1 ]Specify row and column headers:
Import["ExampleData/mountains.sxc", {"Tabular", 1}, "HeaderLines" -> {1, 1}]"SkipLines" (1)
"TimeColumn" (1)
By default, the time column is selected automatically for "TimeSeries" and "EventSeries" elements:
Import["ExampleData/mountains.sxc", {"TimeSeries", 1}]Use the "TimeColumn" option to specify the time column:
Import["ExampleData/mountains.sxc", {"TimeSeries", 1}, "TimeColumn" -> "Height"]Related Guides
History
Introduced in 2007 (6.0) | Updated in 2025 (14.2) ▪ 2025 (14.3) ▪ 2026 (15.0)