title: Reading from CSV file in scala
body: <p>I have a file in that has different data informations about a certain population.</p>
  
  <p>Example of file format: </p>
  
  <pre><code>1880,Mary,F,7065
  1880,Anna,F,2604
  1880,Emma,F,2003
  1880,Elizabeth,F,1939
  </code></pre>
  
  <p><em>We can interpret this data as “In the year 1880, 7065 female babies were born named Mary"</em></p>
  
  <p>I have a function that reads from the file </p>
  
  <pre><code>fromFile(name:String):List[List[String]]
  </code></pre>
  
  <p>fromFile returns a list of lists:</p>
  
  <p>List( List("1880","Mary", "F","7065"))</p>
  
  <p>I am having trouble figuring out how to get the data and parsing it out for a function like this, which takes a nested list and a number,and returns a list of of entries of such year.
   For example if 'n' is 1880, then the return list would return all info about Mary. </p>
  
  <pre><code> object readFile{
    val years = CSV.fromFile("my_file.csv") 
  
  def yearIs(data: List[List[String]], n: Int): List[List[String]] = 
        ??
  }
  </code></pre>
  
  <p>I trying to figure out how to access each element in the returned list and compare it to the given 'int', and return all the data. </p>