Map<String,String> map = new HashMap<String,String>();
FileInputStream fis=new FileInputStream(" 경로 경로 ");
HSSFWorkbook workbook=new HSSFWorkbook(fis);
int rowindex=0;
int columnindex=0;
HSSFSheet sheet=workbook.getSheetAt(0);
int rows=sheet.getPhysicalNumberOfRows();
for(rowindex=0;rowindex<rows-1;rowindex++){
HSSFRow row=sheet.getRow(rowindex);
if(row !=null){
int cells=row.getPhysicalNumberOfCells();
for(columnindex=0;columnindex<=cells;columnindex++){
HSSFCell cell=row.getCell(columnindex);
String value="";
if(cell==null){
continue;
}else{
switch (cell.getCellType()){
case HSSFCell.CELL_TYPE_FORMULA:
value=cell.getCellFormula();
break;
case HSSFCell.CELL_TYPE_NUMERIC:
value=cell.getNumericCellValue()+"";
break;
case HSSFCell.CELL_TYPE_STRING:
value=cell.getStringCellValue()+"";
break;
case HSSFCell.CELL_TYPE_BLANK:
value=cell.getBooleanCellValue()+"";
break;
case HSSFCell.CELL_TYPE_ERROR:
value=cell.getErrorCellValue()+"";
break;
}
}
//System.out.println("각 셀 내용 :"+rows+" / "+value);
map.put(title[columnindex]+"_"+rowindex, value);
}
}
}