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); range.popFront; char[] url = range.front().dup; range.popFront; char[] num = range.front().dup } } }