1
我有一个读取excel并获取信息的应用程序。这是我的代码,从列0和列1读取信息,我想知道的方式从33如何在使用apache poi的循环中的特定单元格上启动?
File file = new File(inFileName);
Workbook workBook = WorkbookFactory.create(file);
Sheet sheet = workBook.getSheetAt(0);
Iterator<Row> rowIter = sheet.rowIterator();
while(rowIter.hasNext()){
Row myRow =rowIter.next();
Cell cell1 = myRow.getCell(0);
Cell cell2 = myRow.getCell(1);
...
Iterator<Cell> cellIter = myRow.cellIterator();
while(cellIter.hasNext()){
Cell myCell = cellIter.next();
}
//bd.addAnimalls(cell1.toString(),cell2.toString());
Toast.makeText(getApplicationContext(), "on inserting", Toast.LENGTH_SHORT).show();
}
我把里面虽然(rowIter.hasNext)? – jose
这是要取代你的循环。我会编辑给你一个更好的主意。 – msitt
你可以编辑我的原始代码吗? – jose