I got this to work with:

```
import std.stdio, std.file, std.csv, std.range;

void main()
{
        std.file.write("test.csv", "0,1,abc\n2,3,def");
        scope(exit) std.file.remove("test.csv");

        static struct Rec { int a, b; char[] c; }

        auto file = File("test.csv", "r");
        foreach (s; csvReader!Rec(file.byLine().joiner("\n")))
        {
                writeln("struct -> ", s);
        }
}
```

I am not sure about using `file.byLine()` here, because `byLine` reuses its buffer, but this is working correctly (for some reason, anyone can comment?) as far as I tested.

Reply via email to