ddsv 0.7.0

A toy delimiter separated text parser


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

D-DSV

Toy implementation of a simplistic csv/tsv/*sv separated value parser library in D. Made for the purpose of getting familiar with D as a language.

Usage

Sample Input

test.tsv


"hello"	goodbye
"line
	""breaks"""

foo	bar
	"fizz"

test.d

import std.stdio;
import dsv;

void main(string[] args) {
  char[5] buffer;
  HeadlessParser tsv = new HeadlessParser('\t', '"', 100);
  char[] tmp;

  do {
    tmp = stdin.rawRead(buffer);
    tsv.write(tmp);
  } while (tmp.length == buffer.length);

  writeln(tsv.read);
}
$ cat test.csv | dub run
[["hello", "goodbye"], ["line\n\t\"breaks\"", ""], ["foo", "bar"], ["", "fizz"]]

TODO

  • Handle headers
Authors:
Dependencies:
none
Versions:
0.7.0 2018-Mar-30
0.6.0 2018-Mar-29
0.5.0 2018-Mar-28
0.4.0 2018-Mar-27
0.3.0 2018-Mar-24
Show all 10 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 17 downloads total

Score:
0.3
Short URL:
ddsv.dub.pm