Provides useful syntax for types that have implicit instances of CsvInput in scope.
Provides useful syntax for types that have implicit instances of CsvInput in scope.
The most common use case is to turn a value into a CsvReader through asCsvReader:
val f: java.io.File = ??? f.asCsvReader[List[Int]](',', true)
A slightly less common use case is to load an entire CSV file in memory through readCsv:
val f: java.io.File = ??? f.readCsv[List, List[Int]](',', true)
Unsafe versions of these methods are also available, even if usually advised against.
Provides useful syntax for that types that have implicit instances of CsvOutput in scope.
Provides useful syntax for that types that have implicit instances of CsvOutput in scope.
The most common use case is to turn a value into a CsvWriter through asCsvWriter:
val f: java.io.File = ??? f.asCsvWriter[List[Int]](',', true)
A slightly less common use case is encode an entire collection to CSV through writeCsv:
val f: java.io.File = ??? f.writeCsv[List[Int]](List(List(1, 2, 3), List(4, 5, 6)), ',', true)
Provides useful syntax for CsvReader[ReadResult[A]]
.
Provides useful syntax for CsvReader[ReadResult[A]]
.
When parsing CSV data, a very common scenario is to get an instance of CsvReader and then use common
combinators such as map
and flatMap
on it. This can be awkward when the actual interesting value is
itself within a ReadResult which also needs to be mapped into. CsvReaderOps provides shortcuts, such as:
val reader: CsvReader[ReadResult[List[Int]]] = ??? // Not the most useful code in the world, but shows how one can map and filter directly on the nested value. reader.mapResult(_.sum).filterResult(_ % 2 == 0)
Provides useful syntax for collections.
Provides useful syntax for collections.
The sole purpose of this implicit class is to encode collections as CSV into a string through asCsv:
List(List(1, 2, 3), List(4, 5, 6)).asCsv(',')