Skip to content

3.03 Parse CSV to a Seq of tuples

mark lister edited this page Feb 26, 2015 · 2 revisions

Parsing CSV to a Seq[TupleN]

import com.github.marklister.collections.io._
val data = new java.io.StringReader("""1, Jan
     | 2, Feb""")
CsvParser[Int,String].iterator(data).toList

res3: List[(Int, String)] = List((1," Jan"), (2," Feb"))