public class CSVWriter extends Object implements AutoClosable:
CSV writer inspired by Python's csv.writer.
The writer supports the common CSV dialect knobs: delimiter, quote character, escape character, double-quote escaping, line terminator and quoting mode (minimal, all, none).
@example `klyn import klyn.io.csv
writer = CSVWriter() writer.writeRow(["name", "note"]) writer.writeRow(["Ada", "uses, commas"]) print(writer.toString())
| Modifier and Type | Member | Description |
|---|---|---|
| public | CSVWriter | Creates a buffered CSV writer. |
| public | CSVWriter | Creates a CSV writer backed by a file name. |
| public | CSVWriter | Creates a CSV writer backed by a file path. |
| public | CSVWriter | Creates a CSV writer on an existing text writer. |
| Modifier and Type | Member | Description |
|---|---|---|
| public override | closeclose() as Void throws IOException: |
Closes the underlying writer when one was provided. |
| public override | toStringtoString() as String: |
Returns the generated CSV text. |
| public | writeRowwriteRow(row as IList<String>) as Void throws IOException: |
Writes one CSV record. |
| public | writeRowswriteRows(rows as IList<ArrayList<String>>) as Void throws IOException: |
Writes all records from an ordered row list. |