XlsReader
Go - lib for read xls (Excel) file
Install / Use
/learn @shakinm/XlsReaderREADME
xlsReader
Библиотека для чтения xls файлов / Golang read xls library
Установка / Installation
$ go get github.com/shakinm/xlsReader
Использование / Using
package main
import (
"fmt"
"github.com/shakinm/xlsReader/xls"
"log"
)
func main() {
workbook, err := xls.OpenFile("small_1_sheet.xls")
if err!=nil {
log.Panic(err.Error())
}
// Кол-во листов в книге
// Number of sheets in the workbook
//
// for i := 0; i <= workbook.GetNumberSheets()-1; i++ {}
fmt.Println(workbook.GetNumberSheets())
sheet, err := workbook.GetSheet(0)
if err!=nil {
log.Panic(err.Error())
}
// Имя листа
// Print sheet name
println(sheet.GetName())
// Вывести кол-во строк в листе
// Print the number of rows in the sheet
println(sheet.GetNumberRows())
for i := 0; i <= sheet.GetNumberRows(); i++ {
if row, err := sheet.GetRow(i); err == nil {
if cell, err := row.GetCol(1); err == nil {
// Значение ячейки, тип строка
// Cell value, string type
fmt.Println(cell.GetString())
//fmt.Println(cell.GetInt64())
//fmt.Println(cell.GetFloat64())
// Тип ячейки (записи)
// Cell type (records)
fmt.Println(cell.GetType())
// Получение отформатированной строки, например для ячеек с датой или проценты
// Receiving a formatted string, for example, for cells with a date or a percentage
xfIndex:=cell.GetXFIndex()
formatIndex:=workbook.GetXFbyIndex(xfIndex)
format:=workbook.GetFormatByIndex(formatIndex.GetFormatIndex())
fmt.Println(format.GetFormatString(cell))
}
}
}
}
Related Skills
node-connect
341.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
341.2kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
frontend-design
84.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
