in reply to Remove whitespace between lines
My immediate thought is, “just use grep on the command line.” You don’t need to write a custom program at all, if you don’t want to. The regular-expression should identify the lines that you want to keep.
An “awk one-liner” is also useful in cases like these. Again, no programming per se.
Within a program, there are many ways to do it ... some you’ve seen will “slurp” the entire file into memory, then manipulate it as a gigantic text-string. However, I prefer to process line-at-a-time text files a line-at-a-time.
|Replies are listed 'Best First'.|
Re^2: Remove whitespace between lines
by Laurent_R (Canon) on Feb 03, 2015 at 22:36 UTC