title: Reading in a .csv file to scala while preserving some of the structure
body: <p>I have just started Scala and came from Python.</p>
  
  <p>I would like to read in a '|' delimited file and preserve the structure of the tables.  Say I have a file that contains something like this:</p>
  
  <pre><code>1|2|3|4
  5|6|7|8
  9|10|11|12
  </code></pre>
  
  <p>I would like a function that would return a structure like this:</p>
  
  <pre><code>List(List(1, 2, 3, 4), List(5, 6, 7, 8), List(9, 10, 11, 12))
  </code></pre>
  
  <p>My code thus far (doesn't work because of type mismatch):</p>
  
  <pre><code>import scala.io.Source
  
  def CSVReader(absPath:String, delimiter:String): List[List[Any]] = {
      println("Now reading... " + absPath)
      val MasterList = Source.fromFile(absPath).getLines().toList
      return MasterList
  }
  
  var ALHCorpus = "//Users//grant//devel//Scala-codes//ALHCorpusList"
  var delimiter = "|"
  
  var CSVContents = CSVReader(ALHCorpus, delimiter)
  </code></pre>