writeDelim

fun AnyFrame.writeDelim(path: Path, delimiter: Char = DELIM_DELIMITER, includeHeader: Boolean = INCLUDE_HEADER, quote: Char? = QUOTE, quoteMode: QuoteMode = QUOTE_MODE, escapeChar: Char? = ESCAPE_CHAR, commentChar: Char? = COMMENT_CHAR, headerComments: List<String> = HEADER_COMMENTS, recordSeparator: String = RECORD_SEPARATOR)
fun AnyFrame.writeDelim(path: String, delimiter: Char = DELIM_DELIMITER, includeHeader: Boolean = INCLUDE_HEADER, quote: Char? = QUOTE, quoteMode: QuoteMode = QUOTE_MODE, escapeChar: Char? = ESCAPE_CHAR, commentChar: Char? = COMMENT_CHAR, headerComments: List<String> = HEADER_COMMENTS, recordSeparator: String = RECORD_SEPARATOR)

Write DataFrame to Delimiter-Separated Text File

Writes this DataFrame to a delimiter-separated text file.

Parameters you can use to customize the process include, for instance, delimiter, includeHeader, quoteMode, and headerComments. See the param list below for all settings.

The integration is built upon Apache Commons CSV.

Similar Functions

With overloads of DataFrame.writeDelim(), you can write delimiter-separated text to File, Path, Appendable, or String.

For example, DataFrame.writeDelim("output.txt")

or DataFrame.writeDelim(File("output.txt"), quoteMode = QuoteMode.ALL)

Converting to a String can be done like this:

DataFrame.toDelimStr(delimiter = ",")

Parameters

path

The path pointing to a file 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.


fun AnyFrame.writeDelim(file: File, delimiter: Char = DELIM_DELIMITER, includeHeader: Boolean = INCLUDE_HEADER, quote: Char? = QUOTE, quoteMode: QuoteMode = QUOTE_MODE, escapeChar: Char? = ESCAPE_CHAR, commentChar: Char? = COMMENT_CHAR, headerComments: List<String> = HEADER_COMMENTS, recordSeparator: String = RECORD_SEPARATOR)

Write DataFrame to Delimiter-Separated Text File

Writes this DataFrame to a delimiter-separated text file.

Parameters you can use to customize the process include, for instance, delimiter, includeHeader, quoteMode, and headerComments. See the param list below for all settings.

The integration is built upon Apache Commons CSV.

Similar Functions

With overloads of DataFrame.writeDelim(), you can write delimiter-separated text to File, Path, Appendable, or String.

For example, DataFrame.writeDelim("output.txt")

or DataFrame.writeDelim(File("output.txt"), quoteMode = QuoteMode.ALL)

Converting to a String can be done like this:

DataFrame.toDelimStr(delimiter = ",")

Parameters

file

The file 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.


fun AnyFrame.writeDelim(writer: Appendable, delimiter: Char = DELIM_DELIMITER, includeHeader: Boolean = INCLUDE_HEADER, quote: Char? = QUOTE, quoteMode: QuoteMode = QUOTE_MODE, escapeChar: Char? = ESCAPE_CHAR, commentChar: Char? = COMMENT_CHAR, headerComments: List<String> = HEADER_COMMENTS, recordSeparator: String = RECORD_SEPARATOR, adjustCsvFormat: AdjustCSVFormat = ADJUST_CSV_FORMAT)

Write DataFrame to Delimiter-Separated Text Appendable

Writes this DataFrame to a delimiter-separated text Appendable.

Parameters you can use to customize the process include, for instance, delimiter, includeHeader, quoteMode, and headerComments. See the param list below for all settings.

The integration is built upon Apache Commons CSV.

Similar Functions

With overloads of DataFrame.writeDelim(), you can write delimiter-separated text to File, Path, Appendable, or String.

For example, DataFrame.writeDelim("output.txt")

or DataFrame.writeDelim(File("output.txt"), quoteMode = QuoteMode.ALL)

Converting to a String can be done like this:

DataFrame.toDelimStr(delimiter = ",")

Parameters

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.