[Info-vax] Removing blank lines from text files
Craig A. Berry
craigberry at nospam.mac.com
Sat Jun 15 18:38:00 EDT 2019
On 6/15/19 4:46 PM, Bill Gunshannon wrote:
> This and other examples will all fail based on the fact that
> the original problem includes lines that although appearing
> blank may in fact contain space characters.
>
> I can think of no simple solution but the problem can be
> handled by any of a number of programming languages if
> one is willing to invest the time.
There is a very simple solution and I've already posted it. Use any
language that supports regular expressions and print only lines that
match at least one non-whitespace character. In case you weren't paying
attention as usual, this is one extremely simple solution (again):
$ perl -i -ne "print if /\S/" temp.txt
More information about the Info-vax
mailing list