Re: Remove all blank lines from a file

2017-08-31 Thread vino via Digitalmars-d-learn
On Thursday, 31 August 2017 at 15:48:31 UTC, Rene Zwanenburg wrote: On Thursday, 31 August 2017 at 14:44:07 UTC, vino wrote: Hi All, Can some provide me a example of how to remove all blank lines from a file. From, Vino.B This one doesn't read the entire file into memory: import

Re: Remove all blank lines from a file

2017-08-31 Thread Rene Zwanenburg via Digitalmars-d-learn
On Thursday, 31 August 2017 at 14:44:07 UTC, vino wrote: Hi All, Can some provide me a example of how to remove all blank lines from a file. From, Vino.B This one doesn't read the entire file into memory: import std.stdio; import std.array; import std.algorithm; import std.uni; void

Re: Remove all blank lines from a file

2017-08-31 Thread Anonymouse via Digitalmars-d-learn
On Thursday, 31 August 2017 at 14:44:07 UTC, vino wrote: Hi All, Can some provide me a example of how to remove all blank lines from a file. From, Vino.B Super verbose, but: import std.stdio; import std.file; import std.algorithm.iteration; enum inFilename = "in.txt"; enum o

Re: Remove all blank lines from a file

2017-08-31 Thread Stefan Koch via Digitalmars-d-learn
On Thursday, 31 August 2017 at 14:44:07 UTC, vino wrote: Hi All, Can some provide me a example of how to remove all blank lines from a file. From, Vino.B ubyte[] fileData; ubyte[] writeThis; uint lastP; fileData = readRaw(fileName); foreach(uint p; ubyte b;fileData) { if (b == '\n

Remove all blank lines from a file

2017-08-31 Thread vino via Digitalmars-d-learn
Hi All, Can some provide me a example of how to remove all blank lines from a file. From, Vino.B