CSVReader
class in package klyn.io.csv

    public class CSVReader extends Object implements IList<ArrayList<String>>:

Object
└ CSVReader
All Implemented Interfaces: IList

RFC-4180 style CSV reader inspired by Python's `csv.reader`.

`CSVReader` materializes rows as an ordered read-only list and is directly iterable with `for row in reader`. Quoted fields may contain delimiters, CR/LF newlines and escaped quotes.

@example ```klyn import klyn.io.csv

reader = CSVReader(StringReader("name,city\n\"Ada, A.\",London")) for row as ArrayList<String> in reader: print(row.join(" | "))

Properties

Modifier and Type | Member | Description
--- | --- | ---
public override readonly property | size `size as ULong:` | Number of parsed rows.

Properties inherited from Object: type
Properties inherited from IList: size
Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | CSVReader `CSVReader( filename as String, delimiter as Char = ',', quoteChar as Char = '"', escapeChar as Char = Char(0), doubleQuote as Boolean = true, skipInitialSpace as Boolean = false, strict as Boolean = true ):` | Reads and parses a CSV file.
public | CSVReader `CSVReader( path as Path, delimiter as Char = ',', quoteChar as Char = '"', escapeChar as Char = Char(0), doubleQuote as Boolean = true, skipInitialSpace as Boolean = false, strict as Boolean = true ):` | Reads and parses a CSV file.
public | CSVReader `CSVReader( reader as TextReader, delimiter as Char = ',', quoteChar as Char = '"', escapeChar as Char = Char(0), doubleQuote as Boolean = true, skipInitialSpace as Boolean = false, strict as Boolean = true ):` | Reads and parses all remaining text from a `TextReader`.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public override | count `count(item as ArrayList<String>) as ULong:` | Counts rows equal to `item`.
public override | join `join(separator as String) as String:` | Joins row textual representations with a separator.
public | readRow `readRow(index as Int) as ArrayList<String>:` | Returns one parsed row.
public | readRows `readRows() as ArrayList<ArrayList<String>>:` | Returns the parsed rows.
public | rows `rows() as ArrayList<ArrayList<String>>:` | Alias for `readRows()`, useful when mirroring Python examples.
public | skip `skip(count as Int) as Void:` | Skips the next parsed rows.

Methods inherited from Object: fromJson, toDict, toJson, toString, toXml
Methods inherited from IList: count, join
Operators

Modifier and Type | Member | Description
--- | --- | ---
public override | operator in(item as ArrayList<String>) as Boolean: | Returns true when `item` is one of the parsed rows.
public | operator[](index as Int) as ArrayList<String>: | Returns one parsed row.

Operators inherited from IList: operator in(item as T) as Boolean, operator[](index as Int) as T