Advertisement
mitrakov

Working with Apache POI

Feb 18th, 2019
514
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.35 KB | None | 0 0
  1. import org.apache.poi.xssf.usermodel.XSSFWorkbook
  2.  
  3. val book = new XSSFWorkbook(filename)
  4. val items = for {
  5.   i <- 0 until book.getNumberOfSheets
  6.   sheet = book.getSheetAt(i)
  7.   j <- 0 until sheet.getPhysicalNumberOfRows
  8.   row = sheet.getRow(j)
  9.   k <- 0 until row.getPhysicalNumberOfCells
  10.   cell = row.getCell(k)
  11. } yield cell.getStringCellValue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement