poi操作Excel实例.doc;;;;;;;;;;;;.;.;.;.;.;.;.;lassEditExcel{ publicstaticvoidmain(String[]args){ Stringpath="f://#";//文件路径 try{ Filefiles=newFile(path); List<String[]>list=getDataList(files);//读取 if(list!=null&&()>0){ for(String[]str:list){ for(inti=0;i<;i++){ (str[i]+"\t"); } (""); } outExcel(list);//poi导出Excel } }catch(Exceptione){ (); } } /** *读取EXCEL * ****@paramfirstrow *从第几行开始读取 ****@return读取后返回数组 */ publicstaticString[][]getData(Filefile,intfirstrow)throwsFileNotFoundException,IOException{ List<String[]>result=newArrayList<String[]>(); introwSize=0; BufferedInputStreamin=newBufferedInputStream(newFileInputStream(file)); POIFSFileSystemfs=newPOIFSFileSystem(in); HSSFWorkbookwb=newHSSFWorkbook(fs); HSSFCellcell=null; for(intsheetIndex=0;sheetIndex<w
poi操作Excel实例 来自淘豆网www.taodocs.com转载请标明出处.