[Info-vax] Removing blank lines from text files
Dave Froble
davef at tsoft-inc.com
Sat Jun 15 19:14:12 EDT 2019
On 6/15/2019 6:38 PM, Craig A. Berry wrote:
> 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
>
But that requires knowing and using perl ....
--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef at tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486
More information about the Info-vax
mailing list