Class

au.id.cxd.text.helpers

IndexedTextCsvReader

Related Doc: package helpers

Permalink

case class IndexedTextCsvReader(skipHeader: Boolean = true, idColumns: Seq[Int] = Seq[Int](), separators: Array[Char] = Array[Char]('\t', ',')) extends CsvReader with Product with Serializable

Read the CSV data and map identifier columns into a resulting map where each row index of the Csv is returned for the corresponding set of identifier columns. Note in the case where the idColumns is an empty sequence no row indexes will be returned. Created by cd on 9/1/17.

Linear Supertypes
Serializable, Serializable, Product, Equals, CsvReader, TextReader, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. IndexedTextCsvReader
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. CsvReader
  7. TextReader
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new IndexedTextCsvReader(skipHeader: Boolean = true, idColumns: Seq[Int] = Seq[Int](), separators: Array[Char] = Array[Char]('\t', ','))

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def extractIdAndData(data: Buffer[String]): (Seq[String], Buffer[String])

    Permalink

    extract the set of ids from the row record.

  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. val idColumns: Seq[Int]

    Permalink
  11. def isComment(line: String): Boolean

    Permalink

    match comments prefixed with #

    match comments prefixed with #

    Definition Classes
    TextReader
  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. def mapi[I1 <: Iterable[I2], I2 <: Iterable[S], S, T](data: I1, accum: T)(blockFn: ((Int, T), I2) ⇒ T): (Int, T)

    Permalink

    map from the data set to the type T returned by the block function

    map from the data set to the type T returned by the block function

    blockFn

    The blockFn takes the parameters (Int,T), I2 The first paramter is a tuple of (Int, T) which allows the row index to be sent as the first item and the accumulator type of T to be supplied as the second item and returns a type of T which is either the same instance of the accumulator or a new accumulator of same type. The block function allows the CsvReader to transform the data into the accumulator type T.

    Definition Classes
    CsvReader
  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. def read[T](file: File, seed: T)(blockFn: (T, String) ⇒ T): T

    Permalink

    read the file and pass each line into the supplied block

    read the file and pass each line into the supplied block

    Attributes
    protected
    Definition Classes
    CsvReader
  18. def readAndIndexCsv(file: File): (Map[Int, Seq[String]], ListBuffer[Buffer[String]])

    Permalink

    read the CSV file, operate upon the headers if necessary and extract an index of row identifiers.

    read the CSV file, operate upon the headers if necessary and extract an index of row identifiers. Remove dentifiers from the resulting CSV data.

  19. def readCsv[T](file: File, seed: T)(blockFn: (T, Buffer[String]) ⇒ T): T

    Permalink

    read data as CSV return a row based table with columns in each row.

    read data as CSV return a row based table with columns in each row.

    blockFn

    : f(T, mutable.Buffer[String]) => T the block function allows accumulation of each line in the Csv into the type T the block function recieves the T accumulator for each row in the CSV and a set of columns as the second parameter. It processes the columns and returns a second row.

    Definition Classes
    CsvReader
  20. def readCsv(file: File): ListBuffer[Buffer[String]]

    Permalink

    read data as CSV return a row based table with columns in each row.

    read data as CSV return a row based table with columns in each row.

    Definition Classes
    CsvReader
  21. def readLines(file: File): ListBuffer[String]

    Permalink

    read all lines in a supplied file

    read all lines in a supplied file

    Definition Classes
    TextReader
  22. def removeComments(lines: List[String]): List[String]

    Permalink

    skip all lines that are either empty or start with the hash # token

    skip all lines that are either empty or start with the hash # token

    Definition Classes
    TextReader
  23. val separators: Array[Char]

    Permalink
    Definition Classes
    IndexedTextCsvReaderCsvReader
  24. val skipHeader: Boolean

    Permalink
  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  26. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from CsvReader

Inherited from TextReader

Inherited from AnyRef

Inherited from Any

Ungrouped