public class GetExcelInfo {
public static void main(String args[]){
File f=new File("c:/test/00.xls");
try {
Workbook book=Workbook.getWorkbook(f);//
Sheet sheet=book.getSheet(0); //获得第一个工作表对象
for(int i=0;i<sheet.getRows();i++){
Cell cell1 = sheet.getCell(0, i);
Cell cell2 = sheet.getCell(1, i);
for(int j=0;j<sheet.getColumns();j++){
Cell cell=sheet.getCell(j, i); //获得单元格
System.out.print(cell.getContents() + " ");
}
System.out.print("\n");
}
} catch (BiffException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}