Chaining input

2015-05-08 Thread Chris via Digitalmars-d-learn
I have the following code that converts input like blah, blub, gobble, dygook to string[] auto f = File(file.txt, r); auto words = f.byLine .map!( a = a.to!(string) .splitter(, ) .filter!(a = a.length)

Re: Chaining input

2015-05-08 Thread Robert burner Schadek via Digitalmars-d-learn
On Friday, 8 May 2015 at 11:00:01 UTC, Chris wrote: I'm sure there is room for improvement. It looks like your reading some kind of comma seperated values (csv). have a look at std.csv of phobos ``` foreach(record; file.byLine.joiner(\n).csvReader!(Tuple!(string, string, int))) {

Re: Chaining input

2015-05-08 Thread Chris via Digitalmars-d-learn
On Friday, 8 May 2015 at 11:14:43 UTC, Robert burner Schadek wrote: On Friday, 8 May 2015 at 11:00:01 UTC, Chris wrote: I'm sure there is room for improvement. It looks like your reading some kind of comma seperated values (csv). have a look at std.csv of phobos ``` foreach(record;