753
yesterday 862
visitor 23,497,449
9

POI 라이브러리를 이용한 Excel 파일 읽기

조회 수 95955 추천 수 0 2011.10.20 15:19:34
  
public static void main(String[] args) throws FileNotFoundException, IOException {
 
        // POSFS을 이용하여 엑셀 워크북을 생성합니다.
        String FilePath = "C:/workspace/StudyJava/testJava/data_inbox/testBook1.xls";
        POIFSFileSystem excel = new POIFSFileSystem(new FileInputStream(FilePath));
        HSSFWorkbook workBook = new HSSFWorkbook(excel);
        HSSFSheet sheet = null;
        HSSFRow row = null;
        HSSFCell cell = null;
        
        // 생성된 워크북을 이용하여 시트 수만큼 돌면서 엑셀 시트 하나씩을 생성합니다.
        int sheetNum = workBook.getNumberOfSheets();
        for (int k = 0; k < sheetNum; k++) {
                System.out.println("Sheet Num : " + k);
                System.out.println("Sheet Name : " + workBook.getSheetName(k));
                sheet = workBook.getSheetAt(k);
                        
                // 생성된 시트를 이용하여 그 행의 수만큼 돌면서 행을 하나씩 생성합니다.
                int rows = sheet.getPhysicalNumberOfRows();
                for (int r = 0; r < rows; r++) {
                        row = sheet.getRow(r);
                        System.out.println("Row : " + row.getRowNum());
                                
                        // 역시나 생성된 행을 이용하여 그 셀의 수만큼 돌면서 셀을 하나씩 생성합니다.
                        int cells = row.getPhysicalNumberOfCells();
                        for (short c = 0; c < cells; c++) { // short 형입니다. 255개가 max!
                                cell = row.getCell(c);
                                        
                                // 셀타입에 따라 출력 메소드 다름.
                                switch (cell.getCellType()) {
                                case 0:
                                        System.out.println("row data(" + cell.getRowIndex()
                                                        + "," + cell.getColumnIndex() + ")"
                                                        + " type : " + cell.getNumericCellValue());
                                        break;
                                case 1:
                                        System.out.println("row data(" + cell.getRowIndex()
                                                        + "," + cell.getColumnIndex() + ")"
                                                        + " type : " + cell.getStringCellValue());
                                        break;
                                }
                        }
                 }
        }
}


출처 : http://blog.naver.com/hateatom/100127339921

 

 

'헬로마켓'과 함께하는 스마트한 중고 아이템 거래

https://www.hellomarket.com


3
profile

jordan11

May 31, 2022
*.59.186.10

Yeezy Shoes

Yeezy Shoes

Yeezy

Yeezy 350

Jordan AJ 1

Jordan 1

Jordans

Jordans Shoes

Jordan 4

Air Jordan 4

Yeezy

Yeezy Shoes

Yeezy Boost

Yeezy Boost 350

Yeezy Slides

Yeezy

Yeezy Shoes

Yeezy

Yeezy Boots

Yeezy

Birkin Bag

Yeezy Crocs

Pandora

Pandora Jewelry

Pandora Jewelry Official Site

Pandora Jewelry

Pandora Charms

Pandora Jewelry

Birkin Bag

Birkin Bags

Birkin Bag

Birkin Bags

Yeezy Slides

Fake Yeezys

Michael Kors Handbags

Michael Kors

Michael Kors Handbags

Michael Kors Outlet

Michael Kors Outlet Online

Jordan 1

Ray Ban Outlet

Ray Bans Outlet

Ray Bans

Rolex Watches

Adidas Yeezy

Adidas Yeezy

Yeezy Shoes

New Yeezys

Ray Bans

Ray Bans UK

Ray Ban Glasses

Ray Ban Sunglasses

Ray Ban Outlet

Ray Bans Outlet

Nike Outlet

Ray-Ban Sunglasses

Nike Factory

Yeezys

Ray Ban Sunglasses

Nike Outlet Online

Nike Outlet

Yeezy Shoes

Nike Trainers

Nike UK

Yeezy

Rolex

Rolex Watches

Pandora Jewelry

Pandora Charms

Pandora Jewelry

Travis Scott Jordan 1

Air Jordans

Jordan 11

Jordan 11

Jordans Shoes

Moncler Outlet

Off White

Yeezy 450

Yeezy 500

Nike Outlet

Jordans 4

Jordan Retro 4

Jordan Shoes

Yeezy

Yeezy 700

Yeezy Supply

Off White Shoes

NFL Jerseys

Fake Yeezys

Retro Jordans

Nike Air Jordan

Jordans Shoes

Yeezy 350 V2

Adidas Yeezy

Yeezy

Yeezy 700

Yeezy

Nike Outlet

Yeezy

Yeezy Foam Runner

Nike Outlet

Nike Outlet

Jordan AJ 1

UNC Jordan 1

Jordan 13

Jordan AJ 1

Yeezy Supply

Yeezy Zebra

Jordan 5

Jordan 1 Low

Air Jordans

Pandora Charms

Adidas UK

Adidas Yeezy

Yeezy 350

Jordan 1

YEEZY SUPPLY

Nike Shoes

Nike Outlet

Pandora Outlet

Air Jordan 4

Adidas Yeezy

Air Jordan 11

Air Jordan 1

Nike Jordans

Jordan 1s

Pandora UK

Nike Jordan 1

Jordan 1

Yeezy Slides

Nike Air VaporMax

Nike Vapormax Flyknit

Air Jordan 1 Mid

Adidas yeezy

Yeezy 350

Nike Shoes

Nike Outlet

Yeezy

NFL Shop Official Online Store

Nike UK

Yeezy

Yeezy 350
profile

nike outlet

June 18, 2022
*.150.196.58

<a href="https://www.yeezyshoes.us.com/"><strong>Yeezy Shoes</strong></a><br />
<a href="https://www.yeezyshoes.us.com/"><strong>Yeezy</strong></a><br />
<a href="https://www.yeezyshoes.us.com/"><strong>Adidas Yeezy</strong></a><br />
<a href="https://www.nikeoutletuk.uk.com/"><strong>Nike UK</strong></a><br />
<a href="https://www.nikeoutletuk.uk.com/"><strong>Nike outlet</strong></a><br />
<a href="https://www.nike-s.us/"><strong>Nike</strong></a><br />
<a href="https://www.nikeoutlet-s.us.com/"><strong>Nike Outlet</strong></a><br />
<a href="https://www.nikeoutlet-store.us/"><strong>Nike Outlet</strong></a><br />
<a href="https://www.nikestore-s.us/"><strong>Nike Store</strong></a><br />
<a href="https://www.nikestore-s.us.com/"><strong>Nike Store</strong></a><br />
<a href="https://www.louissvuitton.de/"><strong>Louis Vuitton</strong></a><br />
<a href="https://www.louissvuitton.de/"><strong>Louis Vuitton Online Shop</strong></a><br />
<a href="https://www.adidasyeezysshoes.com/"><strong>Adidas Yeezy</strong></a><br />
<a href="https://www.adidasyeezysshoes.com/"><strong>Yeezy Shoes</strong></a><br />
<a href="https://www.adidas-yeezys.com/"><strong>Adidas Yeezy</strong></a><br />
<a href="https://www.yeezys-slides.com/"><strong>Yeezy Slides</strong></a><br />
<a href="https://www.yeezyssupply.us.com/"><strong>Yeezy Supply</strong></a><br />
<a href="https://www.goldengoosesneakerss.com/"><strong>Golden Goose</strong></a><br />
<a href="https://www.goldengoosesneakerss.com/"><strong>Golden Goose Sneakers</strong></a><br />
<a href="https://www.airjordans1.us/"><strong>Air Jordan 1</strong></a><br />
<a href="https://www.airjordans1.us/"><strong>Jordan 1</strong></a><br />
<a href="https://www.jordan-shoes.co/"><strong>Jordan Shoes</strong></a><br />
<a href="https://www.jordan1.co/"><strong>Jordan 1</strong></a><br />
<a href="https://www.airjordan1.co/"><strong>Air Jordan 1</strong></a><br />
<a href="https://www.airjordan1.co/"><strong>Jordan 1</strong></a><br />
<a href="https://www.yeezyslides.net/"><strong>Yeezy slides</strong></a><br />
<a href="https://www.yeezy-s.us.com/"><strong>Yeezy</strong></a><br />
<a href="https://www.yeezy-s.us.com/"><strong>Yeezys</strong></a><br />
<a href="https://www.adidas-yeezy.us.com/"><strong>Adidas Yeezy</strong></a><br />
<a href="https://www.raybansunglassess.com/"><strong>Ray Ban Sunglasses</strong></a><br />
<a href="https://www.raybansglasses.us.com/"><strong>Ray Ban Glasses</strong></a><br />
<a href="https://www.chinafjjianzhan.com/"><strong>天目茶碗</strong></a><br />
<a href="https://www.chinafjjianzhan.com/"><strong>曜変天目茶碗</strong></a><br />
<a href="https://www.chinafjjianzhan.com/"><strong>曜変天目</strong></a><br />
<a href="https://www.nike-shoess.us.com/"><strong>Nike Shoes</strong></a><br />
<a href="https://www.jordan-4s.us.com/"><strong>Jordan 4S</strong></a><br />
<a href="https://www.jordan-4s.us.com/"><strong>Jordan 4</strong></a><br />
<a href="https://www.nikeoutlet-shoes.us.com/"><strong>Nike Outle</strong></a><br />
<a href="https://www.jordan-1s.us.com/"><strong>Jordan 1S</strong></a><br />
<a href="https://www.yeezysyeezyshoes.us.com/"><strong>Yeezy Shoes</strong></a><br />
<a href="https://www.yeezy-supplys.us.com/"><strong>Yeezy Supply</strong></a><br />
<a href="https://www.yeezysslides.us.com/"><strong>Yeezy Slides</strong></a><br />
<a href="https://www.cocochanels.com/"><strong>Coco Chanel</strong></a><br />
<a href="https://www.cocochanels.com/"><strong>Chanel</strong></a><br />
<a href="https://www.cocochanels.com/"><strong>Chanel Handbags</strong></a><br />
<a href="https://www.cocochanels.us.com/"><strong>Coco Chanel</strong></a><br />
<a href="https://www.cocochanels.us.com/"><strong>Chanel</strong></a><br />
<a href="https://www.cocochanels.us.com/"><strong>Chanel Handbags</strong></a><br />
<a href="https://www.chanelwestcoast.us.com/"><strong>Chanel West Coast</strong></a><br />
<a href="https://www.houseofgucci.us.com/"><strong>gucci</strong></a><br />
<a href="https://www.yeezy350v2.us.com/"><strong>Yeezy 350</strong></a><br />
<a href="https://www.yeezy-slides.us/"><strong>Yeezy Slides</strong></a><br />
<a href="https://www.yeezysslides.us/"><strong>Yeezy Slides</strong></a><br />
<a href="https://www.yeezy-slides.com/"><strong>Yeezy Slides</strong></a><br />
<a href="https://www.yeezy-slides.com/"><strong>Yeezy</strong></a><br />
<a href="https://www.yeezysupplys.us/"><strong>Yeezy Supply</strong></a><br />
<a href="https://www.yeezy-supplys.us/"><strong>Yeezy Supply</strong></a><br />
<a href="https://www.adidas-yeezy-shoes.us/"><strong>Yeezy Shoes</strong></a><br />
<a href="https://www.adidasyeezyshoes.us/"><strong>Yeezy Shoes</strong></a><br />
<a href="https://www.nike-stores.us.com/"><strong>Nike Store</strong></a><br />
<a href="https://www.nikeshoesoutlets.us/"><strong>Nike Shoes</strong></a><br />
<a href="https://www.nikeshoesoutlets.us/"><strong>Nike Outlet</strong></a><br />
<a href="https://www.nikeshoess.us/"><strong>Nike Shoes</strong></a><br />
<a href="https://www.raybansale.us/"><strong>Ray Ban Sunglasses</strong></a><br />
<a href="https://www.raybansale.us/"><strong>Ray ban Sale</strong></a><br />
<a href="https://www.coachoutletonlines.us/"><strong>Coach</strong></a><br />
<a href="https://www.coachoutletonlines.us/"><strong>Coach outlet</strong></a><br />
<a href="https://www.gucci-outlets.us/"><strong>Gucci Outlet</strong></a><br />
<a href="https://www.lvoutlets.us/"><strong>Louis Vuitton Outlet</strong></a><br />
<a href="https://www.lvoutlets.us/"><strong>Louis Vuitton</strong></a><br />
<a href="https://www.lvoutlets.us/"><strong>Louis Vuitton Handbags</strong></a><br />
<a href="https://www.lvoutlet.us.com/"><strong>Louis Vuitton Outlet</strong></a><br />
<a href="https://www.lvoutlet.us.com/"><strong>Louis Vuitton</strong></a><br />
<a href="https://www.rolexwebsite.us/"><strong>Rolex Watches</strong></a><br />
<a href="https://www.rolexwatchwebsite.us/"><strong>Rolex Watches</strong></a><br />
<a href="https://www.rolexwatchs.us/"><strong>Rolex Watches</strong></a><br />
<a href="https://www.rolexwebsite.us/"><strong>Rolex</strong></a><br />
<a href="https://www.rolexwatchwebsite.us/"><strong>Rolex</strong></a><br />
<a href="https://www.rolexwatchs.us/"><strong>Rolex</strong></a><br />
<a href="https://www.thenorthfaceoutlets.us.com/"><strong>North Face Outlet</strong></a><br />
<a href="https://www.thenorthfaceoutlets.us.com/"><strong>North Face</strong></a><br />
<a href="https://www.thenorthfaceoutlets.us.com/"><strong>The North Face</strong></a><br />
<a href="https://www.nikejordanshoes.us.com/"><strong>Nike Shoes</strong></a><br />
<a href="https://www.nikejordanshoes.us.com/"><strong>Nike Outlet Store</strong></a><br />
<a href="https://www.yeezy-slides.us.com/"><strong>Yeezy Slides</strong></a><br />
<a href="https://www.yeezy-shoess.us.com/"><strong>Yeezy Shoes</strong></a><br />
<a href="https://www.yeezysupplys.us.com/"><strong>Yeezy Supply</strong></a><br />
<a href="https://www.yz-shoes.us.com/"><strong>Yeezy Shoes</strong></a><br />
<a href="https://www.yzshoes.us.com/"><strong>Yeezy Shoes</strong></a><br />
<a href="https://www.burberrysales.us.com/"><strong>Burberry Sale</strong></a><br />
<a href="https://www.burberrysales.us.com/"><strong>Burberry Outlet</strong></a><br />
<a href="https://www.supplyyeezys.us.com/"><strong>Yeezy Supply</strong></a><br />
<a href="https://www.pandoranecklace.us.com/"><strong>Pandora Necklace</strong></a><br />
<a href="https://www.mkoutlet.us.com/"><strong>Michael Kors Outlet</strong></a><br />
<a href="https://www.mkoutlet.us.com/"><strong>Michael Kors</strong></a><br />
<a href="https://www.offwhite-shoes.com/"><strong>Off White Shoes</strong></a><br />
<a href="https://www.moncleroutletfactory.us.com/"><strong>Moncler Outlet</strong></a><br />
<a href="https://www.moncleroutletfactory.us.com/"><strong>Moncler Factory</strong></a><br />
<a href="https://www.monclervests.us.com/"><strong>Moncler Vest</strong></a><br />
<a href="https://www.monclercoats.us.com/"><strong>Moncler Coat</strong></a><br />
<a href="https://www.brambleberry.us.com/"><strong>Burberry Outlet Online</strong></a><br />
<a href="https://www.michaelkorsoutletbag.us.com/"><strong>Michael Kors Outlet </strong></a><br />
<a href="https://www.yeezy-slide.us/"><strong>Yeezy Slides</strong></a><br />
<a href="https://www.adidasyeezyslides.us/"><strong>Yeezy Slides</strong></a><br />
<a href="https://www.adidas-yeezyslides.us/"><strong>Yeezy Slides</strong></a><br />
<a href="https://www.yeezys-slides.us/"><strong>Yeezy Slides</strong></a><br />
<a href="https://www.yeezy-slidess.com/"><strong>Yeezy Slides</strong></a><br />
<a href="https://www.yeezy-supply.net/"><strong>Yeezy Supply</strong></a><br />
<a href="https://www.nikesshoes.us/"><strong>Nike Shoes</strong></a><br />
문서 첨부 제한 : 0Byte/ 2.00MB
파일 제한 크기 : 2.00MB (허용 확장자 : *.*)
List of Articles
번호 제목 글쓴이 날짜 조회 수
9 https http 세션 공유 필터 방법(쿠키 복사) [1] 제리 2018-09-20 40504
8 @Schedule Spring 스프링 스케쥴 설정법 & CronTab [4] 제리 2016-07-21 65284
7 자바 1.7과 1.8의 차이, 스프링 3.0과 4.0의 차이 [1] 제리 2016-06-03 78042
6 java 날짜 format 제리 2013-10-29 45326
5 Java/JSP Tips (웹에디터) 제리 2013-05-13 42159
4 [jsp] 표현언어(EL) ( JSP커스텀 태그와 JSTL (jsp standard Tag Library) [1] 제리 2012-08-06 81103
» POI 라이브러리를 이용한 Excel 파일 읽기 [3] 제리 2011-10-20 95955
2 JAVA File 객체 다루기 [1] 제리 2011-10-20 64234
1 jsp 직접접근 막기 [3] 제리 2011-10-19 54365

Program Note 로그인 :)