xlsx

package
v0.0.0-...-2946602 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddColumnTitle

func AddColumnTitle(structModel interface{}, sheet *xlsx.Sheet)

AddColumnTitle 通过tag添加首行

func AddDataToNewSheet

func AddDataToNewSheet(xlsxFile *xlsx.File, sheetName string, dataList []interface{}, fun func(data *interface{})) error

AddDataToNewSheet 添加数据到新的sheet中

func DeleteFileIfExist

func DeleteFileIfExist(path string) error

DeleteFileIfExist 删除文件

func PathExists

func PathExists(path string) (bool, error)

PathExists 文件是否存在

func ReadSheetRow

func ReadSheetRow(path, sheetName string, fun func(row *xlsx.Row) (interface{}, error)) (dataList []interface{}, err error)

ReadSheetRow 从xlsx文件的制定Sheet中按行读取 fun 是对每一行数据特殊处理的函数

func SaveXlsx

func SaveXlsx(xlsxFile *xlsx.File, path string) error

SaveXlsx 保存处理的文档,会覆盖源文档

func TransferDataToRow

func TransferDataToRow(data interface{}, row *xlsx.Row)

TransferDataToRow 转换结构体类型数据成一行数据

func TransferInterfaceToString

func TransferInterfaceToString(structField reflect.StructField, data interface{}) string

TransferInterfaceToString 将interface转换为String类型 目前只支持 int,float,string,和上述的指针类型

Types

This section is empty.

Jump to

Keyboard shortcuts

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