In this case, you should use scala-csv as the “backend” for reading, as well. The snippet from the other thread would change to
def parseRow(row: Seq[String]): Data = ???
reader // a scala-csv CSVReader
.iterator
.drop(1)
.map(parseRow)
.filter(pred)
.toList
…thus offloading the raw CSV column parsing to scala-csv, leaving only the conversion to Data
to be implemented.
It may still be worth looking into CSV libraries that automagically handle row to case class conversion, as suggested by others, of course.