Command line utilities for tab-separated value files
Jon D via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Wed Apr 13 10:15:14 PDT 2016
On Wednesday, 13 April 2016 at 12:36:56 UTC, Dejan Lekic wrote:
> On Tuesday, 12 April 2016 at 00:50:24 UTC, Jon D wrote:
>>
>> I've open sourced a set of command line utilities for
>> manipulating tab-separated value files.
>
> I rarely need TSV files, but I deal with CSV files every day.
> - It would be nice to test your implementation against std.csv
> (it can use TAB as separator). Did you try to compare the two?
No, I didn't try using the std.csv library utilities. The
utilities all take a delimiter, so comma can be specified, but
that won't handle CSV escaping.
For myself, I'd be more inclined to add TSV-CSV converters rather
than adding native CSV support to each tool, but if you're
working with CSV all the time that'd be nuisance.
If you want, you can try rewriting the inner loop of one of the
tools to use csvNextToken rather than algorithm.splitter.
tsv-select would be the easiest of the tools to try. It'd also be
necessary to replace the writeln for the output to properly add
CSV escapes.
--Jon
More information about the Digitalmars-d-announce
mailing list