Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val file = File("/home/user/file.xlsx")
- val opcPackage = OPCPackage.open(file)
- val workbook = XSSFWorkbook(opcPackage)
- workbook.getSheet("Sheet1").rowIterator().forEach { row ->
- row.cellIterator().forEach { cell ->
- when (cell.cellTypeEnum) {
- CellType.STRING -> print("${cell.stringCellValue}\t")
- CellType.NUMERIC -> print("${cell.numericCellValue}\t")
- else -> print("")
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement