回覆列表
  • 1 # 小紅的甜心

    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;

    }

  • 中秋節和大豐收的關聯?
  • 和諧的英文?