Could anyone help? By using that code, I was able to get a value from an Excel field as well. There is a value for a specific column = 5.
public Integer Check4(int b) throws IOException {
InputStream myxls = new FileInputStream("book.xls");
HSSFWorkbook wb = new HSSFWorkbook(myxls);
HSSFSheet sheet = wb.getSheetAt(0); // first sheet
HSSFRow row = sheet.getRow(0); // first row
//HSSFCell cell0 = row.getCell((short)a); // first arg
HSSFCell cell1 = row.getCell((short)b); // second arg
cell1.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
System.out.println("smth "+ cell1);
return ;
}
However, The output of the such code is:
"smth + 5.0"
I'd get it, how to convert the var cell1 5.0 to 5 ? Math.round, Integer.parseInt() don't, actually, help