[Awesome Go] Use excelize to read and write excel file
excelize
Introduction
Excelize is a library written in pure Go providing a set of functions that allow you to write to and read from XLSX / XLSM / XLTM files. Supports reading and writing spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports complex components by high compatibility, and provided streaming API for generating or reading data from a worksheet with huge amounts of data. This library needs Go version 1.15 or later. The full API docs can be seen using go’s built-in documentation tool, or online at go.dev and docs reference.
Installation
Standard go get:
1 | go get -u github.com/360EntSecGroup-Skylar/excelize/v2 |
Basic Usage
Create spreadsheet
Here is a minimal example usage that will create spreadsheet file.
1 | package main |
Reading spreadsheet
The following constitutes the bare to read a spreadsheet document.
1 | package main |
Add chart to spreadsheet file
With Excelize chart generation and management is as easy as a few lines of code. You can build charts based on data in your worksheet or generate charts without any data in your worksheet at all.
1 | package main |
Add picture to spreadsheet file
1 | package main |