Chaining input

Robert burner Schadek via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri May 8 04:14:42 PDT 2015


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)))
{
     writefln("%s works as a %s and earns $%d per year",
              record[0], record[1], record[2]);
}
```


More information about the Digitalmars-d-learn mailing list