[Info-vax] Removing blank lines from text files
Bill Gunshannon
bill.gunshannon at gmail.com
Sat Jun 15 17:49:09 EDT 2019
On 6/15/19 10:55 AM, Dave Froble wrote:
> On 6/15/2019 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
>>
>
> Ok, tested, it doesn't handle tabs. Modify as:
>
> 30 Linput #1%, L$
> L9$ = Edit$(L$,2%)
> GoTo 30 If L9$=""
>
Reading that is really intuitive... :-)
What about if the input line contains a bunch of space characters,
quantity unspecified?
bill
More information about the Info-vax
mailing list