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 ¶
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.
This method has one notable drawback however - the entire file must be consumed before the channel will be closed. Reading only some of the values will leave an orphaned goroutine and channel behind.
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.