Documentation
¶
Index ¶
- func ApplyTemplateToCells(f *zip.File, templateValues any, fileContent []byte) ([]byte, error)
- func GetCountFromXml(data []byte) (uint, error)
- func GetReferencedSharedStringsByIndexAndCleanup(fileContent []byte) ([]byte, map[int]string, map[int]int, error)
- func GetUniqueCountFromXML(data []byte) (int, error)
- func RecountSharedStringsCountAndUniqueCountAttributes(sharedStringsContent []byte, count uint) ([]byte, error)
- func ToNumberCell(v any) (interface{}, error)
- func UpdateSheet(fileContent []byte, numberCellsValues map[int]string, ...) ([]byte, error)
- type Cell
- type R
- type Row
- type SI
- type SharedStrings
- type Worksheet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyTemplateToCells ¶
ApplyTemplateToCells applies the templateValues to the given file content and returns the modified content.
func GetCountFromXml ¶
GetCountFromXml counts <c t="s"> cells in a sheetN.xml
func GetReferencedSharedStringsByIndexAndCleanup ¶
func GetReferencedSharedStringsByIndexAndCleanup(fileContent []byte) ([]byte, map[int]string, map[int]int, error)
TODO: switch to xml parsing
func GetUniqueCountFromXML ¶
GetUniqueCountFromXML counts the number of <si> tags in sharedStrings.xml
func RecountSharedStringsCountAndUniqueCountAttributes ¶
func RecountSharedStringsCountAndUniqueCountAttributes(sharedStringsContent []byte, count uint) ([]byte, error)
RecountSharedStringsCountAndUniqueCountAttributes updates the count and uniqueCount attributes in sharedStrings.xml with previously obtained count and recalculated uniqueCount
func ToNumberCell ¶
Types ¶
type Cell ¶
type Cell struct {
T string `xml:"t,attr"` // type attribute (e.g. "s" for shared string)
}
Cell represents a <c> element in sheetN.xml
Click to show internal directories.
Click to hide internal directories.