Documentation ¶
Index ¶
- func ColumnNumberToText(columnNumber int) (string, error)
- func ColumnTextToNumber(columnText string) int
- type ExcelCell
- func (r *ExcelCell) GetContent() any
- func (r *ExcelCell) GetContentType() ExcelCellContentType
- func (r *ExcelCell) GetCoordinate() string
- func (r *ExcelCell) GetFontBold() bool
- func (r *ExcelCell) GetFontColor() string
- func (r *ExcelCell) GetFontFamily() string
- func (r *ExcelCell) GetFontItalic() bool
- func (r *ExcelCell) GetFontSize() float64
- func (r *ExcelCell) Init(content any) *ExcelCell
- func (r *ExcelCell) SetContent(content any) *ExcelCell
- func (r *ExcelCell) SetContentType(contentType ExcelCellContentType) *ExcelCell
- func (r *ExcelCell) SetCoordinate(coordinate string) *ExcelCell
- func (r *ExcelCell) SetFontBold(fontBold bool, condition bool) *ExcelCell
- func (r *ExcelCell) SetFontColor(fontColor string, condition bool) *ExcelCell
- func (r *ExcelCell) SetFontFamily(fontFamily string, condition bool) *ExcelCell
- func (r *ExcelCell) SetFontItalic(fontItalic bool, condition bool) *ExcelCell
- func (r *ExcelCell) SetFontSize(fontSize float64) *ExcelCell
- type ExcelCellContentType
- type ExcelReader
- func (r *ExcelReader) AutoRead(filename string, values ...any) *ExcelReader
- func (r *ExcelReader) AutoReadBySheetName(filename, sheetName string, values ...any) *ExcelReader
- func (r *ExcelReader) GetFinishedRow() int
- func (r *ExcelReader) GetOriginalRow() int
- func (r *ExcelReader) GetSheetName() string
- func (r *ExcelReader) GetTitle() []string
- func (r *ExcelReader) GetTitleRow() int
- func (r *ExcelReader) OpenFile(filename string, more ...any) *ExcelReader
- func (r *ExcelReader) Read() *ExcelReader
- func (r *ExcelReader) ReadTitle() *ExcelReader
- func (r *ExcelReader) SetDataByRow(rowNumber uint64, data []string) *ExcelReader
- func (r *ExcelReader) SetFinishedRow(finishedRow int) *ExcelReader
- func (r *ExcelReader) SetOriginalRow(originalRow int) *ExcelReader
- func (r *ExcelReader) SetSheetName(sheetName string) *ExcelReader
- func (r *ExcelReader) SetTitle(titles []string) *ExcelReader
- func (r *ExcelReader) SetTitleRow(titleRow int) *ExcelReader
- func (r *ExcelReader) ToDataFrame(titleWithType map[string]series.Type) dataframe.DataFrame
- func (r *ExcelReader) ToDataFrameDefaultType() dataframe.DataFrame
- func (r *ExcelReader) ToDataFrameDetectType() dataframe.DataFrame
- func (r *ExcelReader) ToList() map[uint64][]string
- func (r *ExcelReader) ToMap(defaultValue string) map[uint64]map[string]string
- type ExcelRow
- type ExcelWriter
- func (r *ExcelWriter) ActiveSheetByIndex(sheetIndex int) *ExcelWriter
- func (r *ExcelWriter) ActiveSheetByName(sheetName string) *ExcelWriter
- func (r *ExcelWriter) AddRow(excelRow *ExcelRow) *ExcelWriter
- func (r *ExcelWriter) CreateSheet(sheetName string) *ExcelWriter
- func (r *ExcelWriter) GetFilename() string
- func (r *ExcelWriter) Init(filename string) *ExcelWriter
- func (r *ExcelWriter) Save() error
- func (r *ExcelWriter) SetFilename(filename string) *ExcelWriter
- func (r *ExcelWriter) SetRows(excelRows []*ExcelRow) *ExcelWriter
- func (r *ExcelWriter) SetTitleRow(titles []string, rowNumber uint64) *ExcelWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColumnNumberToText ¶
ColumnNumberToText 列索引转文字
Types ¶
type ExcelCell ¶
type ExcelCell struct {
// contains filtered or unexported fields
}
ExcelCell Excel单元格
func NewExcelCellFloat64 ¶
NewExcelCellFloat64 构造函数(小数格式)
func NewExcelCellFormula ¶
NewExcelCellFormula 构造函数(公式格式)
func (*ExcelCell) GetContentType ¶
func (r *ExcelCell) GetContentType() ExcelCellContentType
GetContentType 获取单元格类型
func (*ExcelCell) SetContent ¶
SetContent 设置内容
func (*ExcelCell) SetContentType ¶
func (r *ExcelCell) SetContentType(contentType ExcelCellContentType) *ExcelCell
SetContentType 设置单元格类型
func (*ExcelCell) SetCoordinate ¶
SetCoordinate 设置单元格坐标
func (*ExcelCell) SetFontBold ¶
SetFontBold 设置字体粗体
func (*ExcelCell) SetFontColor ¶
SetFontColor 设置字体颜色
func (*ExcelCell) SetFontFamily ¶
SetFontFamily 设置字体
func (*ExcelCell) SetFontItalic ¶
SetFontItalic 设置字体斜体
func (*ExcelCell) SetFontSize ¶
SetFontSize 设置字体字号
type ExcelCellContentType ¶
type ExcelCellContentType string
ExcelCellContentType 单元格内容类型
const ( ExcelCellContentTypeAny ExcelCellContentType = "any" ExcelCellContentTypeFormula ExcelCellContentType = "formula" ExcelCellContentTypeInt ExcelCellContentType = "int" ExcelCellContentTypeFloat64 ExcelCellContentType = "float64" ExcelCellContentTypeBool ExcelCellContentType = "bool" )
type ExcelReader ¶
type ExcelReader struct {
// contains filtered or unexported fields
}
ExcelReader Excel读取器
func (*ExcelReader) AutoRead ¶
func (r *ExcelReader) AutoRead(filename string, values ...any) *ExcelReader
AutoRead 自动读取(默认第一行是表头,从第二行开始,默认Sheet名称为:Sheet1)
func (*ExcelReader) AutoReadBySheetName ¶
func (r *ExcelReader) AutoReadBySheetName(filename, sheetName string, values ...any) *ExcelReader
AutoReadBySheetName 自动读取(默认第一行是表头,从第二行开始)
func (*ExcelReader) GetFinishedRow ¶
func (r *ExcelReader) GetFinishedRow() int
GetFinishedRow 获取读取终止行
func (*ExcelReader) GetOriginalRow ¶
func (r *ExcelReader) GetOriginalRow() int
GetOriginalRow 获取读取起始行
func (*ExcelReader) OpenFile ¶
func (r *ExcelReader) OpenFile(filename string, more ...any) *ExcelReader
OpenFile 打开文件
func (*ExcelReader) SetDataByRow ¶
func (r *ExcelReader) SetDataByRow(rowNumber uint64, data []string) *ExcelReader
SetDataByRow 设置单行数据
func (*ExcelReader) SetFinishedRow ¶
func (r *ExcelReader) SetFinishedRow(finishedRow int) *ExcelReader
SetFinishedRow 设置读取终止行
func (*ExcelReader) SetOriginalRow ¶
func (r *ExcelReader) SetOriginalRow(originalRow int) *ExcelReader
SetOriginalRow 设置读取起始行
func (*ExcelReader) SetSheetName ¶
func (r *ExcelReader) SetSheetName(sheetName string) *ExcelReader
SetSheetName 设置工作表名称
func (*ExcelReader) SetTitle ¶
func (r *ExcelReader) SetTitle(titles []string) *ExcelReader
SetTitle 设置表头
func (*ExcelReader) SetTitleRow ¶
func (r *ExcelReader) SetTitleRow(titleRow int) *ExcelReader
SetTitleRow 设置表头行
func (*ExcelReader) ToDataFrame ¶
ToDataFrame 获取DataFrame类型数据
func (*ExcelReader) ToDataFrameDefaultType ¶
func (r *ExcelReader) ToDataFrameDefaultType() dataframe.DataFrame
ToDataFrameDefaultType 获取DataFrame类型数据 通过Excel表头自定义数据类型
func (*ExcelReader) ToDataFrameDetectType ¶
func (r *ExcelReader) ToDataFrameDetectType() dataframe.DataFrame
ToDataFrameDetectType 获取DataFrame类型数据 通过自动探寻数据类型
type ExcelRow ¶
type ExcelRow struct {
// contains filtered or unexported fields
}
ExcelRow Excel行
func (*ExcelRow) SetRowNumber ¶
SetRowNumber 设置行标
type ExcelWriter ¶
type ExcelWriter struct {
// contains filtered or unexported fields
}
ExcelWriter Excel写入器
func NewExcelWriter ¶
func NewExcelWriter(filename string, a ...any) *ExcelWriter
NewExcelWriter 初始化
func (*ExcelWriter) ActiveSheetByIndex ¶
func (r *ExcelWriter) ActiveSheetByIndex(sheetIndex int) *ExcelWriter
ActiveSheetByIndex 选择工作表(根据编号)
func (*ExcelWriter) ActiveSheetByName ¶
func (r *ExcelWriter) ActiveSheetByName(sheetName string) *ExcelWriter
ActiveSheetByName 选择工作表(根据名称)
func (*ExcelWriter) AddRow ¶
func (r *ExcelWriter) AddRow(excelRow *ExcelRow) *ExcelWriter
AddRow 增加一行行数据
func (*ExcelWriter) CreateSheet ¶
func (r *ExcelWriter) CreateSheet(sheetName string) *ExcelWriter
CreateSheet 创建工作表
func (*ExcelWriter) SetFilename ¶
func (r *ExcelWriter) SetFilename(filename string) *ExcelWriter
SetFilename 设置文件名
func (*ExcelWriter) SetRows ¶
func (r *ExcelWriter) SetRows(excelRows []*ExcelRow) *ExcelWriter
SetRows 设置行数据
func (*ExcelWriter) SetTitleRow ¶
func (r *ExcelWriter) SetTitleRow(titles []string, rowNumber uint64) *ExcelWriter
SetTitleRow 设置标题行