std.csv - ZZ
RFC4180 subset: quoted fields, "" escapes, embedded newlines, CRLF. Rows are [[str]] (first row = header when present). Unterminated trailing quotes are treated as end-of-field.
import std.csvPurpose
Section titled “Purpose”std.csv parses and stringifies CSV. csv.parse(src) uses ,; csv.parse_delim(src, d) uses a custom one-char delimiter. Round-trips via stringify/stringify_delim. Header-keyed JSON via to_json. Suitable for config, data import/export, and simple spreadsheets.
Quickstart
Section titled “Quickstart”import std.csv
rows := csv.parse("a,b\n1,2\n")csv.header(rows) // ["a", "b"]csv.get_cell(rows, 1, 0, "?") // "1"csv.stringify(rows) // round-trips: "a,b\n1,2\n"csv.to_json(rows) // JSON array of objectsAPI reference
Section titled “API reference”14 entries. Signatures come from the compiler’s own FuncSig table, so they match the runtime exactly; descriptions come from the module guide.
See also
Section titled “See also”std.json— Parse, stringify and read individual values out of JSON.std.map— Pure dictionary helpers over plain maps: lookup, merge and keys.std.set— Arrays with uniqueness: membership, union, intersection and difference.std.dec— Exact decimal arithmetic carried as strings, so money never becomes a float.std.property— Seeded generators and shrinking for property-based tests.
Full index: API reference · Standard library