about std.csv and derived format
bioinfornatics
bioinfornatics at fedoraproject.org
Thu Mar 1 02:09:55 PST 2012
Le jeudi 01 mars 2012 à 04:36 +0100, Jesse Phillips a écrit :
> On Thursday, 1 March 2012 at 02:07:44 UTC, bioinfornatics wrote:
>
> > It is ok i have found a way maybe is not an efficient way but
> > it works:
> > https://gist.github.com/1946669
> >
> > a minor bug exist for parse track line will be fixed tomorrow.
> > time to
> > bed
> >
> >
> > Big thanks to all
>
> You can edit a gist instead of creating a new.
>
> This seems like a very fragile implementation, and hard to
> follow. My quick untested code:
>
> auto str = readText(filePath);
>
> // Ignoring first three lines.
> str = array(str.util(newline).until(newline).until(newline));
>
> auto bedInstances =
> csvReader!(BedData11,Malformed.ignore)(str,'\t');
>
> But if you must keep the separate structs, I don't have any
> better suggestions.
and how convert bedInstances input array to BedData11[] ?
Add a constructo to BedData11 and use std.algorithm.map?
map!"BedData11(a.filed1, a.filed2...)"(bedInstances);
More information about the Digitalmars-d-learn
mailing list