MATHEMATICA IMPORT/EXPORT FORMAT
XLS (.xls)
- Import supports XLS files created by Excel 95, 97, 2000, XP, and 2003.
- Export creates files compatible with the Excel 2000 standard.
- Import["file.xls"] imports all sheets of an XLS file, returning the result as a list of arrays.
- Export["file.xls", expr] exports an array or a list of arrays to XLS.
- Import and Export also handle embedded images.
-
- Import["file.xls"] returns the sheets of an XLS file as an expression of the form
, where the
are full arrays containing numerical and textual data, Boolean values, and date specifications.
- Export["file.xls", expr] creates an XLS file from array data.
- The following expression types are supported by Export: Column, Grid, List, MatrixForm, Row, SparseArray, and TableForm.
-
- Import["file.xls", elem] imports the specified element from an XLS file.
- Import["file.xls", {elem, suba, subb, ...}] imports a subelement.
- Import["file.xls", {{elem1, elem2, ...}}] imports multiple elements.
- The import format can be specified with Import["file", "XLS"] or Import["file", {"XLS", elem, ...}].
-
- Export["file.xls", expr, elem] creates an XLS file by treating expr as specifying element elem.
- Export["file.xls", {expr1, expr2, ...}, {{elem1, elem2, ...}}] treats each
as specifying the corresponding
.
- Export["file.xls", expr, opt1->val1, ...] exports expr with the specified option elements taken to have the specified values.
- Export["file.xls", {elem1->expr1, elem2->expr2, ...}, "Rules"] uses rules to specify the elements to be exported.
-
- See the reference pages for full general information on Import and Export.
- ImportString and ExportString support the XLS format.
- General Import elements:
-
| "Elements" | list of elements and options available in this file |
| "Rules" | full list of rules for each element and option |
| "Options" | list of rules for options, properties, and settings |
-
- Data representation elements:
-
| "Data" | list of full arrays, representing all sheets |
| "Formulas" | all XLS formulas as text |
| "Images" | embedded images as a list |
-
- Advanced data elements:
-
| "FormattedData" | data with some styling elements applied |
- See the reference page for "XLSX" for full documentation.
Import the first sheet of an Excel file:
Out[1]//TableForm= |
| |  |
Export a table to XLS:
| Out[1]= |  |
Show the Import elements in a file:
| Out[1]= |  |
Excel stores all numbers using machine precision:
| Out[1]= |  |
Import the first sheet of the generated file:
| Out[2]= |  |
Embed graphics in an XLS file:
| Out[1]= |  |
| Out[2]= |  |
| Out[3]= |  |
Export data and formulas:
| Out[3]= |  |
Export data and formulas using rule syntax:
| Out[4]= |  |
New in 5.1 | Last modified in 8