1. Need to download Jxl.jar package, the study of their own, the code is as follows
Copy Code code as follows:
Package file;
Import Java.io.File;
Import java.io.IOException;
Import java.util.ArrayList;
Import Java.util.HashMap;
Import Java.util.Map;
Import JXL. workbook;
Import jxl.read.biff.BiffException;
Import jxl.write.*;
Import JXL. Sheet;
Import JXL. Cell;
Import JXL. workbook;
Public class Excel {
/**
* @param args
* @throws ioexception
* @throws biffexception
*/
Publi c static void Main (string[] args) throws Biffexception, IOException {
//TODO auto-generated method stub
Workbook bo OK = Workbook.getworkbook (new File ("F://center20130902update.xls"));
Sheet sheet=book.getsheet (0);
ArrayList list = new ArrayList ();
for (int k=2;k<96;k++) {
Map rowdata = new HashMap ();
for (int j=2;j<5;j++) {
Cell cell = Sheet.getcell (j,k);//column, row
Cell Keycell = Sheet.getcell (j,1);
String key = Keycell.getcontents ();
String Content = CelL.getcontents ();
Rowdata.put (key, Content);
}
List.add (RowData);
}
System.out.println (list);
Book.close ();
}
}