public CSVReader( reader as TextReader, delimiter as Char = ',', quoteChar as Char = '"', escapeChar as Char = '\u0000', doubleQuote as Boolean = true, skipInitialSpace as Boolean = false, strict as Boolean = true )
Creates an unstarted CSV cursor over the remaining text of a reader. No input is read by this constructor. The provided reader is borrowed: it is never closed by CSVReader, even after an error or early loop exit. Buffering may read ahead of a record boundary; do not consume the borrowed reader separately while this cursor is active.
| Parameter | Description |
|---|---|
reader | Non-null input whose ownership remains with the caller. |
delimiter | Field delimiter. Default is comma. |
quoteChar | Quote character; U+0000 disables quoting. |
escapeChar | Escape character; U+0000 disables escaping. |
doubleQuote | Decode doubled quotes inside quoted fields. |
skipInitialSpace | Ignore spaces before a field and after a closing quote. |
strict | Reject malformed quoting when the affected record is read. |
try source = StringReader("name,city\n\"Ada, A.\",London"):
for row in CSVReader(source):
print(row.join(" | "))