简体   繁体   English

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

[英]How to count rows and Columns of excel sheet in Java

Is there a way to count the number of rows and columns in an excel table in Java?有没有办法在Java中计算excel表中的行数和列数? I am using XSSF workbook to import and parse the data into the program.我正在使用 XSSF 工作簿将数据导入并解析到程序中。 . . 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.例如,如果有一个 5 行 3 列的表格,则单元格 b2 不会为空。

XSSF 表有一个名为getPhysicalNumberOfRows()的方法来获取您想要的行的外观,但我不知道列。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM