Re: Read text file, line by line?

2011-12-14 Thread bearophile
Kagamin: > AFAIK it used to preserve EOL in the lines. Was it fixed? It keeps them on default, but there is a way to not keep them: http://www.dlang.org/phobos/std_stdio.html#ByLine Bye, bearophile

Re: Read text file, line by line?

2011-12-14 Thread Kagamin
On Tuesday, 13 December 2011 at 14:08:15 UTC, Robert Clipsham wrote: On 13/12/2011 13:58, Iain S wrote: How would one achieve this in D2? I have tried for a couple of hours now and have achieved nothing but stress. import std.stdio; void main() { foreach(line; File("myTextFile.txt").byLi

Re: Read text file, line by line?

2011-12-13 Thread Jonathan M Davis
On Tuesday, December 13, 2011 14:08:14 Robert Clipsham wrote: > On 13/12/2011 13:58, Iain S wrote: > > How would one achieve this in D2? I have tried for a couple of hours > > now and have achieved nothing but stress. > > import std.stdio; > > void main() { > foreach(line; File("myTextFile.

Re: Read text file, line by line?

2011-12-13 Thread Robert Clipsham
On 13/12/2011 13:58, Iain S wrote: How would one achieve this in D2? I have tried for a couple of hours now and have achieved nothing but stress. import std.stdio; void main() { foreach(line; File("myTextFile.txt").byLine()) { writefln(line); } } -- Robert http://octarineparr

Re: Read text file, line by line?

2011-12-13 Thread Iain S
How would one achieve this in D2? I have tried for a couple of hours now and have achieved nothing but stress.