title: Reading Excel file with Scala
body: <p>I am writing a quick test that registers a user with the data from a spreadsheet. </p>
  
  <p>The idea is Go to the website > click register > Read excel rows A1 and B1 for email and password > use this data on registration site> finish the registration > log out > Register a new user with information from rows A2 and B2 > continue until rows in the spreadsheet are empty. </p>
  
  <p>I have managed to automate the registration process with random user information and now I just need to make it do the same with the specific email and password taken from the spreadsheet. </p>
  
  <p>I have tried using Apache Poi, but not exactly sure how to use it and how to make it loop itself until the end of the spreadsheet.</p>
  
  <p>This what I have so far but i believe it's wrong:</p>
  
  <pre><code>val myData = new File("/desktop/files.file.xmls")
  
  val fis = new FileInputStream(myData)
  
  val myWorkbook = new HSSFWorkbook(fis)
  
  val mySheet = myWorkbook.getSheetAt(0)
  
  val rowIterator = mySheet.iterator()
  
  while(rowIterator.hasNext){
  
  val row = rowIterator.next()
  
    val cellIterator = row.cellIterator()
  
    while(cellIterator.hasNext) {
      val cell = cellIterator.next()
        cell.getCellType match {
          case Cell.CELL_TYPE_STRING =&gt; {
            print(cell.getStringCellValue + "\t")
          }
          case Cell.CELL_TYPE_NUMERIC =&gt; {
            print(cell.getNumericCellValue + "\t")
          }
  
          case Cell.CELL_TYPE_BLANK =&gt; {
            print("null" + "\t")
          }
  
        }
    }
    println("")
  </code></pre>