nested csv into tsv

Jesse Phillips jessekphillips+D at gmail.com
Sun Mar 18 08:53:45 PDT 2012


On Sunday, 18 March 2012 at 14:45:42 UTC, bioinfornatics wrote:
> ________________________________
> $ ./test_csv
> std.csv.CSVException@/usr/include/d/std/csv.d(1047): Can't 
> parse string:
> "[" is missing
> std.conv.ConvException@/usr/include/d/std/conv.d(2714): Can't 
> parse
> string: "[" is missing
> std.conv.ConvException@/usr/include/d/std/conv.d(1597): 
> Unexpected 'd'
> when converting from type string to type string[]
> ________________________________

I'm going to harbor a guess that you have confused std.conv.to by 
using two different types for field3

    @property void field3( string field ){
        _field3 = field.split(";");
    }
    @property string[] field3(  ){
        return _field3;
    }

The first says it is a string, the second a string[]. I assume 
that std.conv.to sees field3 as a string[] and is trying to 
convert a string to it. In this case it expects the string to be 
formatted, ["this is an","array","of string"]


More information about the Digitalmars-d-learn mailing list