只能读取97-2003的文件格式xls, 不支持xlsx格式
import java.io.File;import jxl.*;public class ExcelUtils { public static void main(String[] args) { try { Workbook book = Workbook.getWorkbook(new File("c:\\Book1.xls")); // 获得第一个工作表对象 Sheet sheet = book.getSheet(0); // 得到单元格 for (int i = 0; i < sheet.getRows(); i++) { for (int j = 0; j < sheet.getColumns(); j++) { Cell cell = sheet.getCell(j,i); System.out.print(cell.getContents() + " "); } System.out.println(); } book.close(); } catch (Exception e) { System.out.println(e); } }}