如何在Java中计算excel表的行和列

时间:2022-03-15 20:24:42

Is there a way to count the number of rows and columns in an excel table in Java? I am using XSSF workbook to import and parse the data into the program. . There are no empty cells until after the last row or column. For example if there was a table that was 5 rows and 3 columns, cell b2 would not be empty.

是否有一种方法可以在Java中计算excel表中的行数和列数?我正在使用XSSF工作簿将数据导入并解析到程序中。直到最后一行或列之后才有空单元格。例如,如果有一个表是5行3列,那么单元格b2就不是空的。

1 个解决方案

#1


1  

XSSF sheet has a method called getPhysicalNumberOfRows() to get what looks like you want for rows, but I don't know about columns.

XSSF表有一个名为getPhysicalNumberOfRows()的方法,可以得到想要的行,但是我不知道列是什么。

#1


1  

XSSF sheet has a method called getPhysicalNumberOfRows() to get what looks like you want for rows, but I don't know about columns.

XSSF表有一个名为getPhysicalNumberOfRows()的方法,可以得到想要的行,但是我不知道列是什么。