Re: Can you read the next line while iterating over byLine?

2017-02-02 Thread John Doe via Digitalmars-d-learn
On Thursday, 2 February 2017 at 20:26:36 UTC, Daniel Kozak wrote: Dne 2. 2. 2017 20:35 napsal uživatel "John Doe via Digitalmars-d-learn" < digitalmars-d-learn@puremagic.com>: On Thursday, 2 February 2017 at 18:58:46 UTC, Daniel Kozak wrote: [...] Thanks readln is per

Re: Can you read the next line while iterating over byLine?

2017-02-02 Thread John Doe via Digitalmars-d-learn
On Thursday, 2 February 2017 at 18:58:46 UTC, Daniel Kozak wrote: Even this one could works: import std.stdio; void main(string[] args) { auto range = File("text.txt").byLine(); foreach (line; range) { if (line != "") { writeln(line);

Can you read the next line while iterating over byLine?

2017-02-02 Thread John Doe via Digitalmars-d-learn
Let's say you're trying to parse a file format like: Name http://example.com 123234 Foo Bar http://dlang.org 88 with blocks separated by varying amount of blank lines. - import std.stdio; void main(string[] args){ auto range = File("text.txt").byLine(); foreach( line; range