writeDelimImpl

internal fun writeDelimImpl(df: AnyFrame, writer: Appendable, delimiter: Char, includeHeader: Boolean, quote: Char?, quoteMode: QuoteMode, escapeChar: Char?, commentChar: Char?, headerComments: List<String>, recordSeparator: String, adjustCsvFormat: AdjustCSVFormat)

Writes df to writer in a delimiter-separated format.

Parameters

df

The data to write.

writer

The Appendable to write to.

delimiter

The field delimiter character. Default: ','.

Ignored if hasFixedWidthColumns is true.

includeHeader

Whether to include the header in the output. Default: true.

quote

The quote character. Default: ".

Used when field- or line delimiters should be interpreted as literal text.

For example: 123,"hello, there",456, would correspond to: 123; hello, there; 456.

quoteMode

The QuoteMode to use when writing CSV / TSV files. Default: QuoteMode.MINIMAL.

escapeChar

The escape character to use when writing CSV / TSV files with QuoteMode.NONE. Default: null. This will double-quote the value.

commentChar

The character that indicates a comment line in a CSV / TSV file. Default: '#'.

headerComments

A list of comments to include at the beginning of the CSV / TSV file. Default: empty list.

recordSeparator

The character that separates records in a CSV / TSV file. Default: '\n', a Unix-newline.

adjustCsvFormat

Optional extra CSVFormat configuration. Default: { it }.

Before instantiating the CSVFormat, the CSVFormat.Builder will be passed to this lambda. This will allow you to configure/overwrite any CSV / TSV writing options.