I am trying to upload and read contents of an Excel file. It works fine if the content is in String format. But my content in the excel file is as follows:
02:02:02
03:03:03
04:04:04
All I want to do is retrieve the content as it is. But when I pull this data over, I end up getting the content as follows:
8.4745370370370374E-2
0.12711805555555555
0.169490740740741
Is there any way around to not change the content?
while (rowIterator.hasNext())
{
Row row = rowIterator.next();
//For each row, iterate through all the columns
Iterator<Cell> cellIterator = row.cellIterator();
while (cellIterator.hasNext())
{
Cell cell = cellIterator.next();
cell.setCellType(Cell.CELL_TYPE_STRING);
//Check the cell type and format accordingly
switch (cell.getCellType())
{
case Cell.CELL_TYPE_NUMERIC:
System.out.print(cell.getNumericCellValue());
break;
case Cell.CELL_TYPE_STRING:
System.out.print(cell.getStringCellValue());
break;
}
}
}