public String publicExcel( HSSFCell cell){
String value = "";
if(cell==null){
System.out.println("kong");
return value;
}
switch (cell.getCellType()) {
case HSSFCell.CELL_TYPE_NUMERIC:
if(HSSFDateUtil.isCellDateFormatted(cell)){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
value= sdf.format(HSSFDateUtil.getJavaDate(cell.getNumericCellValue())).toString();
//System.out.println("plplpl");
} else{
value = "" + cell.getNumericCellValue();
//System.out.println("ssss");
break;
case HSSFCell.CELL_TYPE_STRING:
value = cell.getStringCellValue();
case HSSFCell.CELL_TYPE_BLANK:
value="";
default:
public String publicExcel( HSSFCell cell){
String value = "";
if(cell==null){
System.out.println("kong");
return value;
}
switch (cell.getCellType()) {
case HSSFCell.CELL_TYPE_NUMERIC:
if(HSSFDateUtil.isCellDateFormatted(cell)){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
value= sdf.format(HSSFDateUtil.getJavaDate(cell.getNumericCellValue())).toString();
//System.out.println("plplpl");
} else{
value = "" + cell.getNumericCellValue();
//System.out.println("ssss");
}
break;
case HSSFCell.CELL_TYPE_STRING:
value = cell.getStringCellValue();
break;
case HSSFCell.CELL_TYPE_BLANK:
value="";
break;
default:
break;
}
return value;
}