public static void readExcelData(String path) throws BiffException, IOException{
Workbook workbook = Workbook.getWorkbook(new File(path));
Sheet sheet = workbook.getSheet(0);//得到excel第一页的内容
String delimiter = "♣";
System.err.println("行数:" + sheet.getRows() + "列数" + sheet.getColumns());// 得到一共多少行多少列
for (int i = 1; i < sheet.getRows(); i++) {
String string = "";
for (int j = 0; j < sheet.getColumns(); j++) {
// sheet.getCell(j,i).getContents();得到指定单元格的内容
string += sheet.getCell(j,i).getContents().equals("") ? " " + delimiter : sheet.getCell(j,i).getContents() + delimiter;
}
System.err.println(string); // 这里就是一行的数据了 我为什么加上面那个三目运算呢?因为业务需要…………
}
}