ODS (.ods)

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:
  • Importimport from a file
    CloudImportimport from a cloud object
    ImportStringimport from a string
    ImportByteArrayimport 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
  • Data representation elements:
  • "Data"list of full arrays, representing all sheets
    "Formulas"all ODS formulas as text
  • 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",kthe k^(th) sheet, given as an array
    "Data",k,mrow m of the k^(th) sheet
    "Data",k,m,ncell {m,n} of the k^(th) 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"list of sheet names
    "Sheets",namesheet name as an array
    "Sheets",name,mrow m of sheet name
    "Sheets",name,m,ncell {m,n} in sheet name
  • Import["file.ods",{"Sheets",All}] is equivalent to Import["file.ods","Data"].
  • Import yields spreadsheets as full rectangular arrays.

Options

  • Import option:
  • "EmptyField"""how empty cells are represented in the Wolfram Language

Examples

Basic Examples  (1)

Import tabular data from an ODS file and format it as a table: