一:读取单元格的值
/**
* 获取EXCEL单元格的值
*
* @param cell
* @return
*/
public static String getCellValue(Cell cell) {
if (cell == null) {
return null;
}
int type = cell.getCellType();
String result;
switch (type) {
case Cell.CELL_TYPE_NUMERIC:
if (DateUtil.isCellDateFormatted(cell)) {
short format = cell.getCellStyle().getDataFormat();
SimpleDateFormat sdf = null;
if (format == 14 || format == 31 || format == 57 || format == 58
|| format == 176 || format == 177) {
sdf = new SimpleDateFormat("yyyy-MM-dd");
} else if (format == 20 || format == 21 || format == 32) {
sdf = new SimpleDateFormat("HH:mm:ss");
}
Date date &