xlsx

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: MIT Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CellIndex

func CellIndex(r string) (int, int)

CellIndex returns the cell index by ref.

func CellRef

func CellRef(i, j int) string

CellRef returns the cell ref by index.

func ColIndex

func ColIndex(r string) int

ColIndex returns the col index by ref.

func ColRef

func ColRef(i int) string

ColRef returns the col ref by index.

func RowIndex

func RowIndex(r string) int

RowIndex returns the row index by ref.

func RowRef

func RowRef(i int) string

RowRef returns the row ref by index.

func Time

func Time(v dt.Value) time.Time

Time converts a dt.Value to time.Time.

func Value

func Value(v time.Time) dt.Value

Value converts a time.Time to dt.Value.

Types

type Cell

type Cell struct {
	Ref   string `xml:"r,attr"`
	Type  string `xml:"t,attr"`
	Value string `xml:"v"`
}

Cell is a cell.

type CellIter

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

CellIter is a cell iter.

type Data

type Data struct {
	XMLName xml.Name
	Rows    []*Row `xml:"sheetData>row"`
}

Data is the sheet data.

type Reader

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

Reader is the xlsx reader.

func NewReader

func NewReader() *Reader

NewReader creates a new reader.

func (*Reader) Drop

func (a *Reader) Drop(o int) *Reader

Drop is the drop option.

func (*Reader) Head

func (a *Reader) Head(o int) *Reader

Head is the head option.

func (*Reader) Read

func (a *Reader) Read(r io.Reader) (*dt.Frame, error)

Read reads a frame from the io.Reader.

func (*Reader) ReadFile

func (a *Reader) ReadFile(name string) (*dt.Frame, error)

ReadFile reads a frame from the file.

func (*Reader) ReadWorkbook

func (a *Reader) ReadWorkbook(workbook *Workbook) (frame *dt.Frame, err error)

ReadWorkbook reads a frame from the workbook.

func (*Reader) ReadZip

func (a *Reader) ReadZip(zr *zip.Reader) (*dt.Frame, error)

ReadZip reads a frame from the zip.Reader.

func (*Reader) Sep

func (a *Reader) Sep(o string) *Reader

Sep is the sep option.

func (*Reader) Sheet

func (a *Reader) Sheet(o string) *Reader

Sheet is the sheet option.

func (*Reader) Suffix

func (a *Reader) Suffix(o string) *Reader

Suffix is the suffix option.

func (*Reader) Tail

func (a *Reader) Tail(o int) *Reader

Tail is the tail option.

type Rel

type Rel struct {
	ID     string `xml:"Id,attr"`
	Target string `xml:"Target,attr"`
}

Rel is a rel.

type Rels

type Rels struct {
	Rels []Rel `xml:"Relationship"`
}

Rels is the rels.

type Row

type Row struct {
	Ref   string  `xml:"r,attr"`
	Cells []*Cell `xml:"c"`
}

Row is a row.

type RowIter

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

RowIter is a row iter.

type SItem

type SItem struct {
	Text  string   `xml:"t"`
	Texts []string `xml:"r>t"`
}

SItem is the string item.

type SSTable

type SSTable struct {
	Items []SItem `xml:"si"`
}

SSTable is the shared strings table.

type Sheet

type Sheet struct {
	ID   string `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr"`
	Name string `xml:"name,attr"`
	// contains filtered or unexported fields
}

Sheet is a sheet.

type Workbook

type Workbook struct {
	Sheets []*Sheet `xml:"sheets>sheet"`
	// contains filtered or unexported fields
}

Workbook is a workbook.

func OpenFile

func OpenFile(name string) (*Workbook, error)

OpenFile opens the workbook from a file.

func OpenReader

func OpenReader(r io.Reader) (*Workbook, error)

OpenReader opens the workbook from a reader.

func OpenZip

func OpenZip(zr *zip.Reader) (*Workbook, error)

OpenZip opens the workbook from a zip reader.

func (*Workbook) Value

func (a *Workbook) Value(sheet string, ref string) (v dt.Value)

Value returns the value by ref.

func (*Workbook) Write

func (a *Workbook) Write(w io.Writer) error

Write writes the workbook to a writer.

func (*Workbook) WriteFile

func (a *Workbook) WriteFile(name string) error

WriteFile writes the workbook to a file.

func (*Workbook) WriteZip

func (a *Workbook) WriteZip(zw *zip.Writer) error

WriteZip writes the workbook to a zip writer.

type Writer

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

Writer is the xlsx writer.

func NewWriter

func NewWriter(filename string) *Writer

NewWriter creates a new writer.

func (*Writer) Sheet

func (a *Writer) Sheet(o string) *Writer

Sheet is the sheet option.

func (*Writer) Template

func (a *Writer) Template(o string) *Writer

Template is the template option.

func (*Writer) WriteFile

func (a *Writer) WriteFile(frame *dt.Frame) (err error)

WriteFile writes frame to a xlsx file.

Jump to

Keyboard shortcuts

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