[Info-vax] Removing blank lines from text files

Dave Froble davef at tsoft-inc.com
Sat Jun 15 19:13:08 EDT 2019


On 6/15/2019 5:46 PM, Bill Gunshannon wrote:
> On 6/15/19 10:31 AM, Dave Froble wrote:
>> On 6/14/2019 11:47 PM, Bob wrote:
>>> Alas, that also finds lines with whitespace but no text.
>>> My files include many of those.
>>>
>>
>> The following simple (untested) program is most likely less typing
>> than has already been spent on this subject.
>>
>> 10      Input "Input filename", F$
>>          Open F$ for Input as File 1%
>>
>> 20      Input "Output filename"; F2$
>>          Open F2$ for Output as File 2%
>>
>>          On Error GoTo 90
>>
>> 30      Linput #1%, L$
>>          GoTo 30 If L$=""
>>      Print #2%, L$
>>      GoTo 30
>>
>> 90      Resume 99 If Erl=30 and Err=11
>>          On Error GoTo 0
>>
>> 99      End
>>
>
> 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.
>
> bill
>

I believe the original request wanted to omit any lines with just white 
space.  My example does just that.

Time?  Less than 60 seconds, with error.  Another 60 seconds to fix.

-- 
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