xlsx

package module
v0.0.0-...-07a1980 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2020 License: MIT Imports: 10 Imported by: 0

README

xlsx

Go Report Card

Read XLSX data without suffering the styles.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustStringToInt

func MustStringToInt(s string) int64

MustStringToInt returns a int64 ignoring any error.

func MustStringToUint

func MustStringToUint(s string) uint64

MustStringToUint returns a uint64 ignoring any error.

func StringToDate

func StringToDate(s string) (t time.Time, err error)

StringToDate converts the string from string to float and to time.Time

func StringToInt

func StringToInt(s string) (int64, error)

StringToInt converts the string to an int64.

func StringToUint

func StringToUint(s string) (uint64, error)

StringToUint converts the string to an uint64.

func ToDate

func ToDate(n float64) time.Time

ToDate converts the date from excel format to time.Time

Types

type Sheet

type Sheet struct {
	// contains filtered or unexported fields
}

Sheet represents an spreadsheet.

func (*Sheet) Open

func (s *Sheet) Open() (*SheetReader, error)

Open opens a sheet to read it.

type SheetReader

type SheetReader struct {
	ReuseRecord bool
	// contains filtered or unexported fields
}

SheetReader creates an structure able to read row by row the spreadsheet data.

func (*SheetReader) Close

func (sr *SheetReader) Close() error

Close closes the sheet file reader.

func (*SheetReader) Error

func (sr *SheetReader) Error() error

Error returns the error occurred during Next().

If no error is returned here but Next() returned false it can be caused because the EOF was reach.

func (*SheetReader) Next

func (sr *SheetReader) Next() bool

Next returns true if the row has been successfully readed.

if false is returned check the Error() function.

func (*SheetReader) Read

func (sr *SheetReader) Read() (record []string, err error)

Read returns the row or error

func (*SheetReader) Row

func (sr *SheetReader) Row() []string

Row returns the last readed row.

type XLSX

type XLSX struct {
	Sheets []*Sheet
	// contains filtered or unexported fields
}

XLSX ...

func Open

func Open(filename string) (*XLSX, error)

Open just opens the file for reading.

func OpenReader

func OpenReader(r io.ReaderAt, size int64) (*XLSX, error)

func (*XLSX) Close

func (xlsx *XLSX) Close() error

Close closes all the buffers and readers.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL