此为 Mathematica 8 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.2)

XLS (.xls)

Registered MIME type: application/vnd.ms-excel
Microsoft Excel spreadsheet file.
XLS is an acronym derived from Excel Spreadsheet.
Stores spreadsheet data and formulas.
  • Import supports XLS files created by Excel 95, 97, 2000, XP, and 2003.
  • Export creates files compatible with the Excel 2000 standard.
  • Import imports all sheets of an XLS file, returning the result as a list of arrays.
  • Export exports an array or a list of arrays to XLS.
  • 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.
  • Import imports the specified element from an XLS file.
  • Import imports multiple elements.
  • The import format can be specified with Import["file", "XLS"] or Import.
  • Export creates an XLS file by treating expr as specifying element elem.
  • Export treats each as specifying the corresponding .
  • Export exports expr with the specified option elements taken to have the specified values.
  • Export uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
"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:
Export a table to XLS:
Show the Import elements in a file:
Excel stores all numbers using machine precision:
Import the first sheet of the generated file:
Embed graphics in an XLS file:
Export data and formulas:
Export data and formulas using rule syntax:
Import the first sheet of an Excel file:
In[1]:=
Click for copyable input
Out[1]//TableForm=
 
Export a table to XLS:
In[1]:=
Click for copyable input
Out[1]=
Show the Import elements in a file:
In[1]:=
Click for copyable input
Out[1]=
 
Excel stores all numbers using machine precision:
In[1]:=
Click for copyable input
Out[1]=
Import the first sheet of the generated file:
In[2]:=
Click for copyable input
Out[2]=
 
Embed graphics in an XLS file:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
 
Export data and formulas:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=
Export data and formulas using rule syntax:
In[4]:=
Click for copyable input
Out[4]=