Skip to main content

Module delimited_spec

Module delimited_spec 

Source
Expand description

Format specs of kind = "delimited": the reading options for a family of CSV-like files, with header rows that have roles (names, units), a metadata line, and a few derived columns.

A spec is parsed in crate::formats, beside the binary specs, and matched by the same match. Reading it is the CSV reader’s: Delimited::apply sets the dialect options a matched file is opened with, and Delimited::derive adds the derived columns to the frame. The only lines read apart from the scan are the header lines and the metadata line (Delimited::facts).

Re-exports§

pub use crate::column_types::Derived;
pub use crate::column_types::DerivedKind;

Structs§

Delimited
A delimited spec’s reading options. Each one left out keeps what the command line or the config says.
DelimitedRead
What a read through a delimited spec found, as the open carries it to the dataset.
HeadFacts
What a file’s header lines say besides its column names.
HeaderRows
What the lines before the data hold, by role.
Metadata
The key="value" line at the top of a file.

Constants§

MAX_HEAD_LINE
The most lines Delimited::facts reads: the header lines and the metadata line sit at the top of a file.

Functions§

check
What datui formats check prints for a delimited spec and, given file, the file’s metadata, units and first rows rows as read with base, the command line’s options, whose typed dialect flags win over the spec’s.
parse_metadata
name, key="value", key=value: the items separated by commas outside quotes. A first item with no = is the title. A line with anything else, or with no pairs, is kept raw only.
read_facts
read with the units and metadata from the header lines of the first of paths, read in options’ dialect.