一、
public class ExcelUtils { public static String parseCellToString(Cell cell){ SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); String result = ""; if(cell.getCellTypeEnum().equals(CellType.STRING)){ result=cell.getStringCellValue(); }else if(cell.getCellTypeEnum().equals(CellType.BLANK)){ result=""; }else if (cell.getCellTypeEnum().equals(CellType.FORMULA)){ result = cell.getCellFormula(); }else if(cell.getCellTypeEnum().equals(CellType.NUMERIC)){ if(HSSFDateUtil.isCellDateFormatted(cell)){ Date date = cell.getDateCellValue(); result = sdf.format(date); }else { result = cell.getNumericCellValue()+""; result = result.substring(0,result.indexOf(".")); } } return result; } }