1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
InputStream inp = new FileInputStream("workbook.xls");
  //InputStream inp = new FileInputStream("workbook.xlsx");
 
  Workbook wb = WorkbookFactory.create(inp);
  Sheet sheet = wb.getSheetAt(0);
  Row row = sheet.getRow(2);
  Cell cell = row.getCell(3);
  if (cell == null)
      cell = row.createCell(3);
  cell.setCellType(Cell.CELL_TYPE_STRING);
  cell.setCellValue("a test");
 
  // Write the output to a file
  FileOutputStream fileOut = new FileOutputStream("workbook.xls");
  wb.write(fileOut);
  fileOut.close();


'Study > JAVA' 카테고리의 다른 글

POI를 이용하여 word, excel 텍스트 추출  (0) 2013.06.26
새로운 엑셀파일 만들기  (0) 2013.06.04
Apache POI  (0) 2013.05.30
코딩시에 꼭 알아야 할 용어들의 이해  (0) 2013.05.13
자바 환경설정  (0) 2013.05.10
Posted by 코딩하는 야구쟁이
,