Bug 11682 – Lazier std.csv.csvReader

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-12-04T05:11:24Z
Last change time
2024-12-01T16:19:22Z
Assigned to
No Owner
Creator
bearophile_hugs
Moved to GitHub: phobos#10015 →

Comments

Comment #0 by bearophile_hugs — 2013-12-04T05:11:24Z
Given a "data.csv" file that contains: 1,2,3,4 5,6,7,8 9,10,11,12 13,14,15,16 With dmd 2.065alpha you can read its contents like this using csvReader: void main() { import std.stdio, std.csv, std.file; "data.csv".readText.csvReader!int.writeln; } Output: [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]] If the file is large you can also read the lines lazily (same output): void main() { import std.stdio, std.csv, std.file, std.algorithm; "data.csv".File.byLine.map!(r => r.csvReader!int.front).writeln; } But I think csvReader should also support reading lines lazily like this: "data.csv".File.csvReader!int.writeln; Or something like this: "data.csv".File.byLine.csvReader!int.writeln;
Comment #1 by robert.schadek — 2024-12-01T16:19:22Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10015 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB