public class CSVReader extends Object implements IList<ArrayList<String>>:
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.
import klyn.io.csv
reader = CSVReader(StringReader("name,city\n\"Ada, A.\",London"))
for row as ArrayList<String> in reader:
print(row.join(" | "))| Modifier and Type | Member | Description |
|---|---|---|
| public override readonly property | sizesize as ULong: |
Number of parsed rows. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | CSVReader | Reads and parses a CSV file. |
| public | CSVReader | Reads and parses a CSV file. |
| public | CSVReader | Reads and parses all remaining text from a TextReader. |
| Modifier and Type | Member | Description |
|---|---|---|
| public override | count | Counts rows equal to item. |
| public override | join | Joins row textual representations with a separator. |
| public | readRow | Returns one parsed row. |
| public | readRows | Returns the parsed rows. |
| public | rows | Alias for readRows(), useful when mirroring Python examples. |
| public | skipskip(count as Int) as Void: |
Skips the next parsed rows. |
| 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. |