Bug 15545 – csv Reader line feed '\r' failure

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-01-10T16:07:15Z
Last change time
2020-03-21T03:56:32Z
Assigned to
Basile-z
Creator
gruen_tobias

Comments

Comment #0 by gruen_tobias — 2016-01-10T16:07:15Z
If a file uses '\r' line feeds and the last character is a linefeed (empty line after the data) Csv Reader will throw a exception at the end of the file. In case of '\n' or "\r\n" as line-feed this is not the case. // Will fail enum failData = "name, surname, age Joe, Joker, 99\r"; enum nonFailData = "name, surname, age Joe, Joker, 99\r\n"; import std.csv, std.stdio; void main(string[] args) { auto reader = csvReader(failData); foreach(entry; reader) { writeln(entry); } } togrue
Comment #1 by github-bugzilla — 2016-01-10T23:14:39Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/82d6dbf8175055e1851bd6601dc20d0f5649e2f7 fix issue 15545, csv Reader line feed '\r' failure https://github.com/D-Programming-Language/phobos/commit/deaee8521c408f5e08749bff1f8b129d5522f685 Merge pull request #3917 from BBasile/issue-15545 fix issue 15545, csv Reader line feed '\r' failure
Comment #2 by github-bugzilla — 2016-03-19T20:22:10Z