excel - 获取Excel工作表中的行数和列数

标签 excel go

<分区>

我正在尝试用 golang 读取一个大的 excel 文件。 我需要找到列数。

我正在使用 https://godoc.org/github.com/360EntSecGroup-Skylar/excelize 库,但我找不到这样的函数。

在 python 中有 https://xlrd.readthedocs.io/en/latest/api.html#xlrd.sheet.Sheet.ncols

Golang 中有类似的东西吗?

最佳答案

Excel 没有固定的列数。您想要的是在所有行中找到的最大列数。

这正是 Sheet.ncols 所做的。 您可以通过调用 GetRows、遍历所有行并找到所有行中列数最多的 excelize 获得相同的结果。

关于excel - 获取Excel工作表中的行数和列数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47895103/

相关文章:

excel - 使用 Excel VBA 将数据附加到 ADO Access 表

api View 中的 golang 后台工作进程

go - 在go项目中打包tor

go - 为什么所有的 goroutines 都在 sleep ?

http - 用net/http构建子路由器的好方法

Go错误: gob: type sync. Mutex没有导出字段

excel - VBA Countif 大写

excel - 通过SSIS动态创建Excel表

c# - 修复记录 : Cell information from worksheet created from scratch

c# - 导入和导出 Excel - 什么是最好的库?