怎么用java实现读取excel表格里的数据生成

2024-11-08 09:51:16
推荐回答(2个)
回答(1):

Cell cell=workbook.getSheetAt(1).getRow(2).getCell(30);

回答(2):

public class AnalyzeExcel {
public static void main(String args[]) throws FileNotFoundException, IOException {
XSSFWorkbook wb = new XSSFWorkbook("D:/TA/Weeky.xlsx");
XSSFSheet sheet = wb.getSheetAt(0);
int totalRows = sheet.getLastRowNum();
for (int i=0; i<=totalRows; i++) {
XSSFRow row = sheet.getRow(i);
System.out.println(row.getCell(1).toString()
);
}
}
}
或者换个java jdk试试