ODS (.ods)
- Import fully supports the ODS standard.
Background & Context
-
- MIME type: application/vnd.oasis.opendocument.spreadsheet
- OpenDocument spreadsheet file.
- Used for storage and exchange of spreadsheet data and formulas.
- Is part of the OASIS Open Document Format (ODF) family of file formats.
- ODS is an acronym derived from OpenDocument Spreadsheet.
- Native spreadsheet format of OpenOffice.org 2.0.
- XML-based format, usually ZIP-compressed.
- Supports multiple sheets in one file.
- Developed by the OASIS industry consortium, based upon the OpenOffice.org SXC format.
- Approved as ISO/IEC 26300 standard in 2006.
Import
- Import["file.ods"] imports all sheets of an ODS file, returning the result as a list of arrays.
- Import["file.ods"] returns the sheets of an ODS 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.ods",elem] imports the specified element from an ODS file.
- Import["file.ods",{elem,suba,subb,…}] imports a subelement.
- Import["file.ods",{{elem1,elem2,…}}] imports multiple elements.
- The import format can be specified with Import["file","ODS"] or Import["file",{"ODS",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 ODS 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.
- ODS data is represented in the Wolfram Language by real or integer numbers, strings, Boolean values True and False, and DateList specifications.
- ODS error cells are imported as $Failed.
- Import["file.ods","Formulas"] gives spreadsheet formulas for each cell in the form {f1,f2,…}, where the fi are arrays corresponding to the sheets of an ODS 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.ods",{"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.ods",{"Sheets",All}] is equivalent to Import["file.ods","Data"].
- Import yields spreadsheets as full rectangular arrays.
Examples
open all close allBasic Examples (2)
Scope (1)
Import Elements (11)
"Data" (4)
Import an ODS file as a list of values:
Import["ExampleData/population.ods", "Data"]This is also the default element:
Import["ExampleData/population.ods"]Import["ExampleData/population.ods", {"Data", 1}]Import["ExampleData/population.ods", {"Data", 1, 1}]Import["ExampleData/population.ods", {"Data", 1, All, 2}]"Dimensions" (1)
"EventSeries" (1)
Import the first sheet of an ODS file as an EventSeries:
Import["ExampleData/population.ods", {"EventSeries", 1}]"SheetCount" (1)
"Sheets" (1)
"Tabular" (1)
Import the first sheet of an ODS file as a Tabular object:
Import["ExampleData/population.ods", {"Tabular", 1}]"TabularAssociation" (1)
Import all sheets as an association of sheet names and Tabular objects:
Import["ExampleData/population.ods", "TabularAssociation"]"TimeSeries" (1)
Import the first sheet of an ODS file as a TimeSeries:
Import["ExampleData/population.ods", {"TimeSeries", 1}]Related Guides
History
Introduced in 2007 (6.0) | Updated in 2025 (14.2) ▪ 2025 (14.3) ▪ 2026 (15.0)