일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- port
- grep
- 줄바꿈 문자
- Quartz
- plugin
- context
- import
- JavaScript
- bash
- profile
- IntelliJ
- find
- maVen
- Windows
- Mac
- Windows 10
- 단축키
- web.xml
- VirtualBox
- xargs
- lsof
- vscode
- resource
- netsh
- GIT
- 네트워크
- Eclipse
- Source
- tomcat
- ssh
- Today
- Total
develog
XSSF read 본문
public void readXSSF() {
InputStream in = null;
try {
File sourceFile = new File("c:/sample.xls");
in = new FileInputStream(sourceFile);
Workbook wb = WorkbookFactory.create(in);
Sheet sheet = wb.getSheetAt(0);
for (Iterator<Row> rit = sheet.rowIterator(); rit.hasNext(); ) {
Row row = rit.next();
for (Iterator<Cell> cit = row.cellIterator(); cit.hasNext(); ) {
Cell cell = cit.next();
System.out.print(cell + "\t");
}
System.out.println();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (InvalidFormatException e) {
e.printStackTrace();
} finally {
try {
if (in != null) in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
'Dev > Java' 카테고리의 다른 글
Thread (0) | 2012.05.10 |
---|---|
console 에서 java 실행 (0) | 2012.05.09 |
XSSF write (0) | 2012.04.29 |
XSSF iterate (0) | 2012.04.28 |
JDBC Driver 버전 확인 (0) | 2012.04.26 |