On 10/07/2012 02:42 PM, Rene Zwanenburg wrote:

> For the sake of cleanliness (and Walter's article on component
> programming ;) ), is there a way to treat a file as an InputRange of
> characters? I think this is quite a common use case.

I've just discovered the undocumented byRecord:

Again, assuming that deneme.txt contains:

1,2,3.5
6,7,8.5

import std.stdio;

void main()
{
    auto someFile = File("deneme.txt");

    writeln(someFile.byRecord!(int, int, float)("%s,%s,%s"));
}

And there is std.algorithm.joiner:

    writeln(someFile.byLine.joiner);

There must be something more straightforward though. :)

Ali

Reply via email to