In Scala, how to read a simple CSV file having a header in its first line?

You can just use drop:

val iter = src.getLines().drop(1).map(_.split(":"))

From the documentation:

def drop (n: Int) : Iterator[A]:
Advances this iterator past the first
n elements, or the length of the
iterator, whichever is smaller.

Leave a Comment

tech