Http://www.cnblogs.com/wuxinrui/archive/2011/03/20/1989326.html
ImportJava.io.File;ImportJXL. Cell;ImportJXL. Sheet;ImportJXL. Workbook; Public classReadexcel { Public Static voidMain (string[] args) {Try { //Create workbook directly from a local file (. xls)String excelfile = "Book1.xls"; Workbook Workbook= Workbook.getworkbook (NewFile (excelfile)); //get the first sheet tableSheet rs = workbook.getsheet (0); //Once you get the sheet, you can access Excel cell (term: cell) through it. //step three: accessing cell cell//gets the first row, the value of the first columnCell c00 = Rs.getcell (0, 0); String strc00=c00.getcontents (); //gets the value of the first row, the second columnCell C10 = Rs.getcell (1, 0); String STRC10=c10.getcontents (); //Gets the second row, the value of the second columnCell C11 = Rs.getcell (1, 1); String Strc11=c11.getcontents (); System.out.println ("Cell (0, 0)" + "value:" + strc00 + "; Type: "+C00.gettype ()); System.out.println ("Cell (1, 0)" + "value:" + STRC10 + "; Type: "+C10.gettype ()); System.out.println ("Cell (1, 1)" + "value:" + Strc11 + "; Type: "+C11.gettype ()); //gets the fourth row, the value of the first columnCell c03 = Rs.getcell (0,3); System.out.println ("Line fourth, the value of the first column:" +c03.getcontents ()); String Contents= Rs.getcell (0,4). getcontents ();//get an empty stringSystem.out.println ("line fifth, value of first column:" +contents); String S44= Rs.getcell (3, 3). getcontents (); System.out.println (S44); } Catch(Exception e) {e.printstacktrace (); } }}
Java Operations Excel file