CsvIterator
io.github.quafadas.scautable.CsvIterator
class CsvIterator[K <: Tuple](filePath: String) extends Iterator[NamedTuple[K, StringyTuple[K & Tuple]]]
A NamedTuple representation of a CSV file.
It is a (lazy) iterator that reads a CSV file line by line and converts each line into a NamedTuple.
Attempting to use the iterator a second time will throw a StreamClosedException
. Common usage
def csvIterator = CSV.resource("simple.csv")
val csvData = csvIterator.toSeq
Note that at this point, you are plugged right into the scala collections API.
csvData.filter(_.column("colA") == "foo").drop(10).take(5).map(_.column("colB"))
etc
Attributes
- Graph
-
- Supertypes
-
trait IterableOnceOps[NamedTuple[K, StringyTuple[K & Tuple]], Iterator, Iterator[NamedTuple[K, StringyTuple[K & Tuple]]]]class Objecttrait Matchableclass AnyShow all
Members list
Type members
Inherited classlikes
Attributes
- Inherited from:
- Iterator
- Supertypes
-
class AbstractIterator[Seq[B]]trait Iterator[Seq[B]]trait IterableOnceOps[Seq[B], Iterator, Iterator[Seq[B]]]trait IterableOnce[Seq[B]]class Objecttrait Matchableclass AnyShow all
Value members
Concrete methods
Attributes
- Definition Classes
-
Iterator
Attributes
- Definition Classes
-
Iterator
Inherited methods
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
def copyToArray[B >: NamedTuple[K, StringyTuple[K & Tuple]]](xs: Array[B], start: Int, len: Int): Int
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
def corresponds[B](that: IterableOnce[B])(p: (NamedTuple[K, StringyTuple[K & Tuple]], B) => Boolean): Boolean
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
def distinctBy[B](f: NamedTuple[K, StringyTuple[K & Tuple]] => B): Iterator[NamedTuple[K, StringyTuple[K & Tuple]]]
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
def dropWhile(p: NamedTuple[K, StringyTuple[K & Tuple]] => Boolean): Iterator[NamedTuple[K, StringyTuple[K & Tuple]]]
Attributes
- Inherited from:
- Iterator
def duplicate: (Iterator[NamedTuple[K, StringyTuple[K & Tuple]]], Iterator[NamedTuple[K, StringyTuple[K & Tuple]]])
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
def filter(p: NamedTuple[K, StringyTuple[K & Tuple]] => Boolean): Iterator[NamedTuple[K, StringyTuple[K & Tuple]]]
Attributes
- Inherited from:
- Iterator
def filterNot(p: NamedTuple[K, StringyTuple[K & Tuple]] => Boolean): Iterator[NamedTuple[K, StringyTuple[K & Tuple]]]
Attributes
- Inherited from:
- Iterator
def find(p: NamedTuple[K, StringyTuple[K & Tuple]] => Boolean): Option[NamedTuple[K, StringyTuple[K & Tuple]]]
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Definition Classes
-
Iterator -> IterableOnceOps
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnce
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
def max[B >: NamedTuple[K, StringyTuple[K & Tuple]]](implicit ord: Ordering[B]): NamedTuple[K, StringyTuple[K & Tuple]]
Attributes
- Inherited from:
- IterableOnceOps
def maxBy[B](f: NamedTuple[K, StringyTuple[K & Tuple]] => B)(implicit ord: Ordering[B]): NamedTuple[K, StringyTuple[K & Tuple]]
Attributes
- Inherited from:
- IterableOnceOps
def maxByOption[B](f: NamedTuple[K, StringyTuple[K & Tuple]] => B)(implicit ord: Ordering[B]): Option[NamedTuple[K, StringyTuple[K & Tuple]]]
Attributes
- Inherited from:
- IterableOnceOps
def maxOption[B >: NamedTuple[K, StringyTuple[K & Tuple]]](implicit ord: Ordering[B]): Option[NamedTuple[K, StringyTuple[K & Tuple]]]
Attributes
- Inherited from:
- IterableOnceOps
def min[B >: NamedTuple[K, StringyTuple[K & Tuple]]](implicit ord: Ordering[B]): NamedTuple[K, StringyTuple[K & Tuple]]
Attributes
- Inherited from:
- IterableOnceOps
def minBy[B](f: NamedTuple[K, StringyTuple[K & Tuple]] => B)(implicit ord: Ordering[B]): NamedTuple[K, StringyTuple[K & Tuple]]
Attributes
- Inherited from:
- IterableOnceOps
def minByOption[B](f: NamedTuple[K, StringyTuple[K & Tuple]] => B)(implicit ord: Ordering[B]): Option[NamedTuple[K, StringyTuple[K & Tuple]]]
Attributes
- Inherited from:
- IterableOnceOps
def minOption[B >: NamedTuple[K, StringyTuple[K & Tuple]]](implicit ord: Ordering[B]): Option[NamedTuple[K, StringyTuple[K & Tuple]]]
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
def partition(p: NamedTuple[K, StringyTuple[K & Tuple]] => Boolean): (Iterator[NamedTuple[K, StringyTuple[K & Tuple]]], Iterator[NamedTuple[K, StringyTuple[K & Tuple]]])
Attributes
- Inherited from:
- Iterator
def patch[B >: NamedTuple[K, StringyTuple[K & Tuple]]](from: Int, patchElems: Iterator[B], replaced: Int): Iterator[B]
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
def reduceLeft[B >: NamedTuple[K, StringyTuple[K & Tuple]]](op: (B, NamedTuple[K, StringyTuple[K & Tuple]]) => B): B
Attributes
- Inherited from:
- IterableOnceOps
def reduceLeftOption[B >: NamedTuple[K, StringyTuple[K & Tuple]]](op: (B, NamedTuple[K, StringyTuple[K & Tuple]]) => B): Option[B]
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
def reduceRight[B >: NamedTuple[K, StringyTuple[K & Tuple]]](op: (NamedTuple[K, StringyTuple[K & Tuple]], B) => B): B
Attributes
- Inherited from:
- IterableOnceOps
def reduceRightOption[B >: NamedTuple[K, StringyTuple[K & Tuple]]](op: (NamedTuple[K, StringyTuple[K & Tuple]], B) => B): Option[B]
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
def span(p: NamedTuple[K, StringyTuple[K & Tuple]] => Boolean): (Iterator[NamedTuple[K, StringyTuple[K & Tuple]]], Iterator[NamedTuple[K, StringyTuple[K & Tuple]]])
Attributes
- Inherited from:
- Iterator
def splitAt(n: Int): (Iterator[NamedTuple[K, StringyTuple[K & Tuple]]], Iterator[NamedTuple[K, StringyTuple[K & Tuple]]])
Attributes
- Inherited from:
- IterableOnceOps
def stepper[S <: Stepper[_]](implicit shape: StepperShape[NamedTuple[K, StringyTuple[K & Tuple]], S]): S
Attributes
- Inherited from:
- IterableOnce
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- Iterator
def takeWhile(p: NamedTuple[K, StringyTuple[K & Tuple]] => Boolean): Iterator[NamedTuple[K, StringyTuple[K & Tuple]]]
Attributes
- Inherited from:
- Iterator
override def tapEach[U](f: NamedTuple[K, StringyTuple[K & Tuple]] => U): Iterator[NamedTuple[K, StringyTuple[K & Tuple]]]
Attributes
- Definition Classes
-
Iterator -> IterableOnceOps
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
-
Iterator -> Any
- Inherited from:
- Iterator
Attributes
- Inherited from:
- IterableOnceOps
def withFilter(p: NamedTuple[K, StringyTuple[K & Tuple]] => Boolean): Iterator[NamedTuple[K, StringyTuple[K & Tuple]]]
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
def zipAll[A1 >: NamedTuple[K, StringyTuple[K & Tuple]], B](that: IterableOnce[B], thisElem: A1, thatElem: B): Iterator[(A1, B)]
Attributes
- Inherited from:
- Iterator
Attributes
- Inherited from:
- Iterator
Deprecated and Inherited methods
Attributes
- Deprecated
-
[Since version 2.13.0]
Use foldLeft instead of /: - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Use foldRight instead of :\\ - Inherited from:
- IterableOnceOps
def aggregate[B](z: => B)(seqop: (B, NamedTuple[K, StringyTuple[K & Tuple]]) => B, combop: (B, B) => B): B
Attributes
- Deprecated
-
[Since version 2.13.0]
For sequential collections, prefer `foldLeft(z)(seqop)`. For parallel collections, use `ParIterableLike#aggregate`. - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Use `dest ++= coll` instead - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
hasDefiniteSize on Iterator is the same as isEmpty - Definition Classes
-
Iterator -> IterableOnceOps
- Inherited from:
- Iterator
Attributes
- Deprecated
-
[Since version 2.13.0]
Call scanRight on an Iterable instead. - Inherited from:
- Iterator
Attributes
- Deprecated
-
[Since version 2.13.0]
Iterator.seq always returns the iterator itself - Inherited from:
- Iterator
Attributes
- Deprecated
-
[Since version 2.13.0]
Use .iterator instead of .toIterator - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Use .to(LazyList) instead of .toStream - Inherited from:
- IterableOnceOps
In this article