Notwendigkeit, '120%' Wert von Excel in Java mit Apache POI zu extrahieren. Ich habe versucht, mit CELL_TYPE_NUMERIC und CELL_TYPE_STRING was fehlgeschlagen und das Ergebnis war 1,2 statt 120%.Wie liest man Eingaben aus Excel in Java?
N: mit Apostrophe (') vor 120% funktioniert, aber bitte eine andere Arbeit um
if(row.getCell(j)!=null)
{
if(row.getCell(j).getCellType() ==row.getCell(j).CELL_TYPE_NUMERIC)
{
System.out.print(row.getCell(j).toString());
}
else if(row.getCell(j).getCellType() == row.getCell(j).CELL_TYPE_STRING)
strCellValue ==System.out.print(row.getCell(j).toString());
}
}
else System.out.print("null")
relevant Stück Code sorgen. – ManishChristian
@ManishChristian if (row.getCell (j)! = Null) { \t if (row.getCell (j) .getCellType() == row.getCell (j) .CELL_TYPE_NUMERIC) \t { \t \t System.out.print (row.getCell (j) .toString()); \t} \t else if (row.getCell (j) .getCellType() == row.getCell (j) .CELL_TYPE_STRING) \t { \t \t strCellValue = \t \t System.out.print (row.getCell (j) .toString()); \t} } sonst System.out.print („Null“) –
Könnten Sie bitte Ihren Code auf Ihre Frage innerhalb Code Klammern hinzufügen – alexbt