Documentation
¶
Overview ¶
Package xls reads legacy Microsoft Excel .xls (BIFF8) workbooks. It exposes the sheet names of a workbook and streams each sheet's rows without loading the whole sheet into memory.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cell ¶
type Cell struct {
// Column is the spreadsheet-style column label, e.g. "A", "B", "AA".
Column string
// Value holds the actual value of the cell. Its type is indicated by Type.
Value any
// Index is the 0-based index of this cell within its row.
Index int
// Type indicates the type of value stored in this cell.
Type CellType
}
Cell is a single spreadsheet cell.
type File ¶
type File struct {
// contains filtered or unexported fields
}
File is an opened .xls workbook. Call Close when done with it.
func OpenFile ¶
OpenFile opens the .xls workbook at path. The returned File must be closed with Close.
func OpenReader ¶
OpenReader opens a .xls workbook from r. Unlike OpenFile, the caller retains ownership of r and Close will not close it.
func (*File) ReadRows ¶
ReadRows streams the rows of the sheet named sheetName in order. Rows are produced synchronously as the returned sequence is iterated.
func (*File) SheetNames ¶
SheetNames returns the names of the workbook's visible worksheets, in the order they appear in Excel.
type Row ¶
type Row struct {
// Index is the 0-based index of this row within the sheet.
Index int
// Cells holds the individual cells in this row.
Cells []Cell
// Error holds any error encountered while reading this row.
Error error
// FirstCol and LastCol are the 0-based range of columns that carry
// data in this row, as recorded by Excel's ROW record.
FirstCol uint16
LastCol uint16
}
Row is one row of cells read from a sheet. If Error is non-nil, the other fields are not meaningful.