Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- log.info cell.getNumericCellValue()
- log.info cell.getStringCellValue()
- import org.apache.poi.xssf.usermodel.*
- def fs = new FileInputStream("C:\File\Book2.xlsx")
- def wb = new XSSFWorkbook(fs)
- def ws = wb.getSheet("Sheet1")
- def r = ws.getPhysicalNumberOfRows()
- for(def i=0; i<r; i++){
- def row = ws.getRow(i)
- def c = row.getPhysicalNumberOfCells()
- for (def j=0; j<c; j++) {
- def cell = row.getCell(j)
- log.info cell.getStringCellValue()
- }
- }
- java.lang.illegalStateException:Cannot get a STRING value from a NUMERIC cell
- java.lang.illegalStateException:Cannot get a NUMERIC value from a STRING cell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement