Tag: collections

Excel Java – 将一行单元格值传递给ArraList

我想知道如何将整个行的单元格值存储到ArrayList中 防爆。 Table_Alphabet Col1 | Col2 | Col3 | COL4 阿尔法| Beta | 伽玛| 三angular洲 mono | poly | tera | EXA 所以,在这里我想取第一行{Alpha,Beta,Gamma,Delta}并将整行存储到ArrayList中。 我试图使用ArrayList的这个单元格值(使用Apache POI!) ArrayList<String> level1 = new ArrayList<String>(); 然后将该ArrayList存储到可以包含实际arrayList的parent_ArrayList ArrayList<ArrayList<String>> parent_list = new ArrayList<ArrayList<String>>(); 但我没有通过这个。 for(int i=0;i<noOfRows;i++){ Row row = sheet.getRow(i); for(int j=0; j<lastCell;j++){ Cell cell = row.getCell(j); switch (cell.getCellType()) { case Cell.CELL_TYPE_STRING: […]