Documentation
¶
Overview ¶
Package xls provides support for reading and writing Microsoft Excel 97-2003 binary format (.xls) files, also known as BIFF8 (Binary Interchange File Format).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cell ¶
type Cell struct {
Row, Col int
Type CellType
Style *Style
// contains filtered or unexported fields
}
Cell represents a single cell in a worksheet.
func (*Cell) Value ¶
Value returns the cell content as a human-readable string regardless of type:
- Empty → ""
- String → the string value
- Number → decimal representation (no trailing zeros)
- Bool → "TRUE" or "FALSE"
- Date → "2006-01-02" (date-only) or "2006-01-02T15:04:05Z" when the time component is non-zero
- Error → "#NULL!", "#DIV/0!", "#VALUE!", "#REF!", "#NAME?", "#NUM!", "#N/A", or "#ERR!<code>" for unknown codes
- Formula → the cached calculation result, formatted by the same rules as the concrete types above (string/number/bool/date/error)
type Font ¶
type Font struct {
Name string
Size float64 // in points
Bold bool
Italic bool
Underline bool
Color uint32 // RGB
}
Font holds font information.
type NumberFormat ¶
NumberFormat holds a number format string.
type Row ¶
type Row struct {
Index int
// contains filtered or unexported fields
}
Row represents a single row in a worksheet.
type Sheet ¶
type Sheet struct {
// contains filtered or unexported fields
}
Sheet represents a single worksheet within a workbook.
func (*Sheet) Strings ¶
Strings returns all cell values as a 2-D slice of strings.
Each element is the result of Cell.Value(): numbers, booleans, dates, and errors are converted to their human-readable form; empty/nil cells become empty strings. Trailing empty columns within a row are preserved up to the row's last non-empty column, and trailing empty rows at the bottom of the sheet are omitted.
type Style ¶
type Style struct {
FontIndex int
FormatIndex int // Number format index
XFIndex int // Extended format index
}
Style holds formatting attributes for a cell.
type Workbook ¶
type Workbook struct {
Sheets []*Sheet
}
Workbook represents an XLS workbook.
func Read ¶
func Read(r io.ReadSeeker) (*Workbook, error)
Read parses an XLS workbook from r. It supports BIFF8 format (Excel 97–2003, .xls).
func (*Workbook) SheetByName ¶
SheetByName returns the first sheet with the given name, or nil if not found.
func (*Workbook) SheetCount ¶
SheetCount returns the number of sheets in the workbook.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
example
|
|
|
xlsdump
command
xlsdump は XLS ファイルを読み込み、全シートのセルデータを [][]string として取得して標準出力に表示するサンプルプログラムです。
|
xlsdump は XLS ファイルを読み込み、全シートのセルデータを [][]string として取得して標準出力に表示するサンプルプログラムです。 |
|
xlsread
command
xlsread reads an XLS file and prints each sheet as a [][]string.
|
xlsread reads an XLS file and prints each sheet as a [][]string. |
|
internal
|
|
|
biff
Package biff implements reading and writing of Binary Interchange File Format (BIFF8) record streams, as used inside the "Workbook" stream of an XLS file.
|
Package biff implements reading and writing of Binary Interchange File Format (BIFF8) record streams, as used inside the "Workbook" stream of an XLS file. |
|
cfb
Package cfb implements reading and writing of Microsoft Compound File Binary (CFB) files, also known as OLE2 / Structured Storage.
|
Package cfb implements reading and writing of Microsoft Compound File Binary (CFB) files, also known as OLE2 / Structured Storage. |
|
codepage
Package codepage provides helpers for decoding legacy Windows code-page encoded strings found in older BIFF records.
|
Package codepage provides helpers for decoding legacy Windows code-page encoded strings found in older BIFF records. |
|
formula
Package formula handles encoding and decoding of BIFF8 formula token streams.
|
Package formula handles encoding and decoding of BIFF8 formula token streams. |