Apache POI - XSSF:Row.getCell()
我正在使用 XSSF 访问 .xlsx 格式。提取行数据和单元格数据是由
Row.getCell(1) // to get the first cell data.
Is there a way to access cells like
Row.getCell(A) or Row.getCell(AC).
这对我访问列非常有帮助。 谁能告诉我如何做到这一点?
I am using XSSF to access the .xlsx format. Extracting row data and cell data is being done by
Row.getCell(1) // to get the first cell data.
Is there a way to access cells like
Row.getCell(A) or Row.getCell(AC).
This will be very helpfull for me to access columns.
Can any one tell me the way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您正在寻找的主要课程是 CellReference< /a> - 它处理面向用户的引用(例如“B2”)与文件格式引用(例如 row=1,col=1 )之间的转换。那里有一个静态方法可以处理您的确切用例,convertColStringToIndex
对于您的用例,您需要类似的代码
I think the main class you're looking for is CellReference - it handles converting between user facing references such as "B2" into file format references like row=1,col=1 . There's a static method on there that handles your exact use case, convertColStringToIndex
For your use case, you'd want code something like
如果我没记错的话,问题是关于使用其引用来访问单元格。
通过这种方式,我们可以使用单元格的引用来引用单元格。
The question is regarding reaching out a cell using its references, if I am not wrong.
In this way we can refer a cell using its reference.