Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cell ¶
Cell represents the data in a single cell as a consumable format.
func (Cell) ColumnIndex ¶
ColumnIndex gives a number, representing the column the cell lies beneath.
type XlsxFile ¶
type XlsxFile struct { Sheets []string // contains filtered or unexported fields }
XlsxFile defines a populated XLSX file struct.
func NewReader ¶
NewReader takes bytes of Xlsx file and returns a populated XlsxFile struct for it. If the file cannot be found, or key parts of the files contents are missing, an error is returned.
func NewReaderZip ¶
NewReaderZip takes zip reader of Xlsx file and returns a populated XlsxFile struct for it. If the file cannot be found, or key parts of the files contents are missing, an error is returned.
func (*XlsxFile) ReadRows ¶
ReadRows provides an interface allowing rows from a specific worksheet to be streamed from an xlsx file. In order to provide a simplistic interface, this method returns a channel that can be range-d over.
If you want to read only some of the values, please ensure that the Close() method is called after processing the entire file to stop all active goroutines and prevent any potential goroutine leaks.
Notes: Xlsx sheets may omit cells which are empty, meaning a row may not have continuous cell references. This function makes no attempt to fill/pad the missing cells.
type XlsxFileCloser ¶
type XlsxFileCloser struct { XlsxFile // contains filtered or unexported fields }
XlsxFileCloser wraps XlsxFile to be able to close an open file
func OpenFile ¶
func OpenFile(filename string) (*XlsxFileCloser, error)
OpenFile takes the name of an XLSX file and returns a populated XlsxFile struct for it. If the file cannot be found, or key parts of the files contents are missing, an error is returned. Note that the file must be Close()-d when you are finished with it.
func OpenReaderZip ¶
func OpenReaderZip(rc *zip.ReadCloser) (*XlsxFileCloser, error)
OpenReaderZip takes the zip ReadCloser of an XLSX file and returns a populated XlsxFileCloser struct for it. If the file cannot be found, or key parts of the files contents are missing, an error is returned. Note that the file must be Close()-d when you are finished with it.
func (*XlsxFileCloser) Close ¶
func (xl *XlsxFileCloser) Close() error
Close closes the XlsxFile, rendering it unusable for I/O.
func (*XlsxFileCloser) GetSheetFileForSheetName ¶
func (xl *XlsxFileCloser) GetSheetFileForSheetName(sheetName string) *zip.File
GetSheetFileForSheetName returns the sheet file associated with the sheet name. This is useful when you want to further process something out of the sheet, that this library does not handle. For example this is useful when trying to read the hyperlinks section of a sheet file; getting the sheet file enables you to read the XML directly.