-
-
Save stephen-lazaro/cd8e84efda7ef887d1afd4a624309011 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final case class Loan( | |
id: Int, | |
balance: Double, | |
loanState: String | |
) | |
val workbook = WorkbookFactory.create(i).getSheetAt(0) | |
val idIndex = 0 | |
val balanceIndex = 1 | |
val loanStateIndex = 2 | |
val balances: Iterator[Balance] = sheet.iterator() | |
.asScala | |
.map(row => { | |
val id = row.getCell(idIndex).toInt | |
val balance = row.getCell(balanceIndex).toDouble | |
val loanState = row.getCell(loanStateIndex) | |
Loan(id, balance, loanState) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment