Skip to main content

Module csv

Module csv 

Source
Expand description

Delimited text tables (CSV, RFC 4180).

Fields may be quoted with ", and quoted fields may contain the delimiter, line breaks and doubled quotes ("" for a literal "). Records end with LF or CRLF; a trailing line break is optional. Writing quotes exactly the fields that need it.

See the book entry Data files.

Structs§

CsvTable
A parsed table: an optional header row and the records, all as strings.

Functions§

format_csv
Formats a table as delimited text with LF line endings.
format_csv_f64
Formats numeric rows (with an optional header); numbers use Rust’s shortest round-trip representation, so parsing the text back recovers them exactly.
parse_csv
Parses delimited text. With has_header the first record becomes the header.
read_csv_file
Reads a delimited text file.
write_csv_file
Writes a delimited text file.