基于 Golang 的 xls 读取类库 go-xls

码农软件 · 软件分类 · Excel开发包 · 2019-09-16 18:59:16

软件介绍

Golang 编写的 xls 读取类库,能够实现 xls 表格的读取功能

部分代码:

func (w *WorkBook) ReadAllCells() (res [][]string) {
    for _, sheet := range w.Sheets {
        w.PrepareSheet(sheet)
        if sheet.MaxRow != 0 {
            temp := make([][]string, sheet.MaxRow+1)
            for k, row := range sheet.Rows {
                data := make([]string, 0)
                if len(row.Cols) > 0 {
                    for _, col := range row.Cols {
                        if uint16(len(data)) <= col.LastCol() {
                            data = append(data, make([]string, col.LastCol()-uint16(len(data))+1)...)
                        }
                        str := col.String(w)
                        for i := uint16(0); i < col.LastCol()-col.FirstCol()+1; i++ {
                            data[col.FirstCol()+i] = str[i]
                        }
                    }
                    temp[k] = data
                }
            }
            res = append(res, temp...)
        }
    }
    return
}


本文地址:https://www.codercto.com/soft/d/14744.html

Dive Into Python 3

Dive Into Python 3

Mark Pilgrim / Apress / 2009-11-6 / USD 44.99

Mark Pilgrim's Dive Into Python 3 is a hands-on guide to Python 3 (the latest version of the Python language) and its differences from Python 2. As in the original book, Dive Into Python, each chapter......一起来看看 《Dive Into Python 3》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

URL 编码/解码
URL 编码/解码

URL 编码/解码

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器