poi的用法笔记



InputStream myxls = new FileInputStream("workbook.xls"));
HSSFWorkbook wb     = new HSSFWorkbook(myxls);


HSSFSheet sheet = wb.getSheetAt(0);       
HSSFRow row     = sheet.getRow(2);        
HSSFCell cell   = row.getCell((short)3);  



HSSFWorkbook wb = new HSSFWorkbook();
FileOutputStream fileOut
   = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();

HSSFSheet sheet = wb.createSheet();
HSSFRow row     = sheet.createRow((short)0); 
HSSFCell cell   = row.createCell((short)0); 
cell.setCellValue(1); 
row.createCell((short)1).setCellValue(1.2); 
row.createCell((short)2).setCellValue("一个字符串");
row.createCell((short)3).setCellValue(true);


你可能感兴趣的:(java)