在 Apache POI API 中提取电子表格列中的数据
只是想确定一件事。
Apache POI API 是否有针对电子表格中的列的任何内置集合/对象(例如行和单元格)?
或者我是否必须自己构建一个并添加该列中的所有单元格以进行排序等?还有其他更好的方法吗?
Just want to make sure one thing.
Does the Apache POI API have any built-in collection/object, like row and cell, for a column in a spreadsheet?
Or do I have to build one myself and add all the cells in the column there to do the sorting etc? Is there any other better way to do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Excel 格式是基于行而不是基于列 - 文件是按顺序写入一行中的每个单元格,后跟一些行信息,然后按顺序排列下一行的单元格等。
所以,如果你想这样做以列为基础的东西,您需要自己收集单元格。它可能是这样的:
The excel format is row based not column based - the file is written with each cell in a row in order, followed by a few bits of row info, then the cells of the next row in order etc.
So, if you want to do something on a column basis, you'll need to collect the cells up yourself. It'd likely be something like: