excel

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

excel processing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InMergeCell

func InMergeCell(rowIdx int, colIdx int, mcels []MergeCell) (string, bool)

Check if (x,y) in merge cell.

func OverwriteMergeCell

func OverwriteMergeCell() func(o *readExcelOp)

Merge cell content is written to each row to maintain the overall structure.

Without this option, merge cells' content only appear in the first row (just like how xlsx is normally converted to csv).

func WithHyperlink(postprocess ...func(link string) string) func(o *readExcelOp)

Include hyperlink if any.

func Write added in v0.4.9

func Write(rail miso.Rail, fpath string, sheet string, records [][]string) error

Types

type ExcelSheet

type ExcelSheet struct {
	Name        string
	Records     [][]string
	MergedCells []MergeCell
}

func ReadExcel

func ReadExcel(rail miso.Rail, fpath string, ops ...func(*readExcelOp)) ([]ExcelSheet, error)

Read Excel File.

Notice the whole excel file is loaded into memory.

See OverwriteMergeCell.

func (*ExcelSheet) Append

func (e *ExcelSheet) Append(r []string)

type MergeCell

type MergeCell struct {
	StartAxis string // axis of top left cell. E.g., "C2".
	EndAxis   string // axis of bottom right cell. E.g., "D4".
	Val       string

	StartX int  // top left cell row no, e.g., "2" in "C2".
	StartY byte // top left cell col index, e.g., "C" in "C2".

	EndX int  // bottom right cell row no, e.g., "4" in "D4".
	EndY byte // bottom right cell col index, e.g., "D" in "D4"
}

Present a merge cell in excel sheet.

E.g., "C2:D4".

func BuildMergeCell

func BuildMergeCell(t excelize.MergeCell) MergeCell

Jump to

Keyboard shortcuts

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