【发布时间】:2016-03-05 18:39:38
【问题描述】:
我正在使用 row.getCell(); 从每个指定列中每一行的 Excel 文件中获取数据;我希望这些数据位于 ArrayList 中。如何将 Cell srs 的内容转换为 ArrayList。
for(Row row : sheet){
if(row.getRowNum() == 0)
continue;
Cell Rk = row.getCell(2);
Cell seed = row.getCell(1);
Cell srs = row.getCell(7);
System.out.println(srs);
This is what it prints
0.974
0.588
0.213
ect.
【问题讨论】:
-
您使用的是 Apache POI 吗? (即,
Cell是导入的org.apache.poi.ss.usermodel.Cell吗?) -
好吧,documentation...
-
是的,我正在使用 apache POI
-
单元格数 = row.getCell(7);双 srs = numbers.getNumericCellValue();好吧,我试过了,但现在我很困惑,因为双 srs 是多个不同的数字?
-
想通了,谢谢
标签: java excel arraylist apache-poi cell