Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractFromCell ¶
Types ¶
type CSVImporter ¶
type CSVImporter struct {
// contains filtered or unexported fields
}
func NewCSVImporter ¶
func NewCSVImporter(filename string) *CSVImporter
func (*CSVImporter) ExportExcel ¶
func (x *CSVImporter) ExportExcel() error
func (*CSVImporter) GetSheet ¶
func (x *CSVImporter) GetSheet(name string) (*Sheet, error)
GetSheet returns a Sheet of the specified sheet name.
func (*CSVImporter) GetSheets ¶
func (x *CSVImporter) GetSheets() ([]*Sheet, error)
type ExcelImporter ¶
type ExcelImporter struct {
Meta *tableaupb.WorkbookMeta
// contains filtered or unexported fields
}
func NewExcelImporter ¶
func NewExcelImporter(filename string, sheets []string, parser SheetParser, includeMetaSheet bool) *ExcelImporter
TODO: options
func (*ExcelImporter) ExportCSV ¶
func (x *ExcelImporter) ExportCSV() error
func (*ExcelImporter) GetSheet ¶
func (x *ExcelImporter) GetSheet(name string) (*Sheet, error)
GetSheet returns a Sheet of the specified sheet name.
func (*ExcelImporter) GetSheets ¶
func (x *ExcelImporter) GetSheets() ([]*Sheet, error)
func (*ExcelImporter) NeedParseMeta ¶
func (x *ExcelImporter) NeedParseMeta() bool
type Importer ¶
type Option ¶
type Option func(*Options)
Option is the functional option type.
func Header ¶
func Header(header *options.HeaderOption) Option
func Parser ¶
func Parser(sp SheetParser) Option
type Options ¶
type Options struct {
Format format.Format // file format: Excel, CSV, XML. Default: Excel.
Sheets []string // sheet names to import
Parser SheetParser // parser to parse the worksheet
Header *options.HeaderOption // header settings.
}
type RowCells ¶
type RowCells struct {
Row int // row number
// contains filtered or unexported fields
}
func NewRowCells ¶
func (*RowCells) CellDebugString ¶
func (*RowCells) GetCellCountWithPrefix ¶
type Sheet ¶
type Sheet struct {
Name string
MaxRow int
MaxCol int
Rows [][]string // 2D array of string.
Meta *tableaupb.SheetMeta
}
type SheetParser ¶
type XMLImporter ¶
type XMLImporter struct {
// contains filtered or unexported fields
}
func NewXMLImporter ¶
func NewXMLImporter(filename string, header *options.HeaderOption) *XMLImporter
TODO: options
func (*XMLImporter) GetSheet ¶
func (x *XMLImporter) GetSheet(name string) (*Sheet, error)
GetSheet returns a Sheet of the specified sheet name.
func (*XMLImporter) GetSheets ¶
func (x *XMLImporter) GetSheets() ([]*Sheet, error)
Click to show internal directories.
Click to hide internal directories.