https://github.com/dgrr/xlsx
Fast XLSX reader. Doesn't read formats nor styles, only data.
https://github.com/dgrr/xlsx
golang nobullshit reader xlsx
Last synced: 5 months ago
JSON representation
Fast XLSX reader. Doesn't read formats nor styles, only data.
- Host: GitHub
- URL: https://github.com/dgrr/xlsx
- Owner: dgrr
- License: mit
- Created: 2020-03-18T15:51:01.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-21T19:43:18.000Z (over 6 years ago)
- Last Synced: 2025-11-23T02:21:27.687Z (8 months ago)
- Topics: golang, nobullshit, reader, xlsx
- Language: Go
- Homepage:
- Size: 56.6 KB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xlsx
[](https://goreportcard.com/report/github.com/dgrr/xlsx)
[](https://travis-ci.com/dgrr/xlsx)
[](https://codecov.io/gh/dgrr/xlsx)
Working with XLSX is most of the times a pain (is built with XML). This package aims to work with XLSX files to extract only the data inside. It doesn't manage styles or any other fancy feature. It supports shared strings (because it's not a fancy feature) and it is fast and easy to use.
```go
package main
import (
"fmt"
"log"
"os"
"github.com/dgrr/xlsx"
)
func main() {
// open the XLSX file.
ws, err := xlsx.Open(os.Args[1])
if err != nil {
log.Fatalln(err)
}
defer ws.Close() // do not forget to close
// iterate over the sheets
for _, wb := range ws.Sheets {
r, err := wb.Open()
if err != nil {
log.Fatalln(err)
}
for r.Next() { // get next row
fmt.Println(r.Row())
}
if r.Error() != nil { // error checking
log.Fatalln(r.Error())
}
// don't forget to close the sheet!!
r.Close()
}
}
```