http://poi.apache.org/
Arquivo da tag: Apache POI
Cannot get a text value from a numeric cell “Poi”
import org.apache.poi.ss.usermodel.DataFormatter;
FileInputStream fis = new FileInputStream(workbookName);
Workbook workbook = WorkbookFactory.create(fis);
Sheet sheet = workbook.getSheet(sheetName);
DataFormatter formatter = new DataFormatter();
String val = formatter.formatCellValue(sheet.getRow(row).getCell(col));
list.add(val); //Adding value to list
https://stackoverflow.com/questions/30125465/cannot-get-a-text-value-from-a-numeric-cell-poi
Apache POI – Reading and Writing Excel file in Java
Como posso ler cadeias numéricas em células do Excel como String (e não números) com Apache POI?
Eu resolvi esse problema com:
cell.setCellType(Cell.CELL_TYPE_STRING);
Antes de começar a ler a cadeia, independente de como o usuário formatou a célula.