goxlsx

package
v1.2.130 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

README

go xlxs

基于这个库封装
go get github.com/xuri/excelize/v2

  • 目前只支持写一个sheet

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CsvRead added in v1.2.125

type CsvRead struct {
	FilePath string
	Comma    rune //csv 列分割符 0 表示默认
}

func NewCsvReader added in v1.2.125

func NewCsvReader(csvFile string, comma rune) (*CsvRead, error)

comma 默认传 ','

func (*CsvRead) ReadGBKAll added in v1.2.125

func (c *CsvRead) ReadGBKAll() ([][]string, error)

func (*CsvRead) ReadGBKLine added in v1.2.125

func (c *CsvRead) ReadGBKLine(lineDataFunc func(record []string) error) error

func (*CsvRead) ReadUTF16All added in v1.2.125

func (c *CsvRead) ReadUTF16All() ([][]string, error)

func (*CsvRead) ReadUTF16Line added in v1.2.125

func (c *CsvRead) ReadUTF16Line(lineDataFunc func(record []string)) error

func (*CsvRead) ReadUTF8All added in v1.2.125

func (c *CsvRead) ReadUTF8All() ([][]string, error)

func (*CsvRead) ReadUTF8Line added in v1.2.125

func (c *CsvRead) ReadUTF8Line(lineDataFunc func(record []string)) error

type XlsxRead added in v1.2.122

type XlsxRead struct {
	XlsxFile *excelize.File
}

需要扩展按行读取文件

func NewReader added in v1.2.125

func NewReader(xlsxFile string) (*XlsxRead, error)

func (*XlsxRead) Close added in v1.2.125

func (r *XlsxRead) Close() error

func (*XlsxRead) GetRows added in v1.2.125

func (r *XlsxRead) GetRows(sheetName string) error

type XlsxWrite added in v1.2.116

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

扩展需要append to file 功能

func NewWriter added in v1.2.125

func NewWriter() *XlsxWrite

func (*XlsxWrite) AppendData added in v1.2.116

func (x *XlsxWrite) AppendData(data []interface{}) *XlsxWrite

func (*XlsxWrite) AppendRows added in v1.2.116

func (x *XlsxWrite) AppendRows(data [][]interface{}) *XlsxWrite

func (*XlsxWrite) Output added in v1.2.116

func (x *XlsxWrite) Output(w http.ResponseWriter, filename string) (err error)

func (*XlsxWrite) OutputForGin added in v1.2.117

func (x *XlsxWrite) OutputForGin(ctx *gin.Context, filename string) (err error)

func (*XlsxWrite) Save2File added in v1.2.116

func (x *XlsxWrite) Save2File(filename string) (err error)

func (*XlsxWrite) SetSheetName added in v1.2.116

func (x *XlsxWrite) SetSheetName(sheetName string) *XlsxWrite

func (*XlsxWrite) SetTitles added in v1.2.116

func (x *XlsxWrite) SetTitles(titles []string) *XlsxWrite

Jump to

Keyboard shortcuts

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