klyn.io.csv.CSVReader.CSVReader
constructor
public CSVReader(
path as Path,
delimiter as Char = ',',
quoteChar as Char = '"',
escapeChar as Char = '\u0000',
doubleQuote as Boolean = true,
skipInitialSpace as Boolean = false,
strict as Boolean = true,
encoding as String = "auto"
)
Description

Opens a CSV path without parsing its records. The generator owns the file.

Parameters
ParameterDescription
pathRegular file to read.
delimiterField delimiter. Default is comma.
quoteCharQuote character; U+0000 disables quoting.
escapeCharEscape character; U+0000 disables escaping.
doubleQuoteDecode doubled quotes inside quoted fields.
skipInitialSpaceIgnore spaces before a field and after a closing quote.
strictReject malformed quoting when the affected record is read.
encodingCharset name; auto selects the Unicode BOM or UTF-8.
Throws
  • CSVException for a null path or invalid dialect.
  • IOException if opening the file or selecting its encoding fails.
Example

try reader = CSVReader(Path("contacts.csv")): print(reader.next())