d4_dsv

Creator: coderz1093

Last updated:

0 purchases

d4_dsv Image
d4_dsv Images

Languages

Categories

Add to Cart

Description:

d4 dsv

A parser and formatter for delimiter-separated values, such as CSV and TSV.
These tabular formats are popular with spreadsheet programs such as
Microsoft Excel, and are often more space-efficient than JSON. This
implementation is based on
RFC 4180.
Comma (CSV) and tab (TSV) delimiters are built-in. For example, to parse:
csvParse("foo,bar\n1,2"); // ([{foo: 1, bar: 2}], columns: [foo, bar])
tsvParse("foo\tbar\n1\t2"); // ([{foo: 1, bar: 2}], columns: [foo, bar])
copied to clipboard
Or to format:
csvFormat([{"foo": "1", "bar": "2"}]); // "foo,bar\n1,2"
tsvFormat([{"foo": "1", "bar": "2"}]); // "foo\tbar\n1\t2"
copied to clipboard
To use a different delimiter, such as “|” for pipe-separated values, use
DsvFormat:
final psv = DsvFormat("|");

print(psv.parse("foo|bar\n1|2")); // ([{foo: 1, bar: 2}], columns: [foo, bar])
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.