[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: excessive 'newlines'

Tim Bynum wrote:
>Hello All,
>I have been doing some clean up (as promised) and have found a work around
>for the undocumented "feature" in sgmltools that produces all the
>unneeded/unwanted 'newlines' at the beginning and end of the bulk of
Thanks for doing this.  It's needed doing for a long time.

>I don't *think* that using cat -s is an option in that sometimes 
>more than 2 consecutive blank lines are needed in the doc.
I don't agree.  Since terminals, monitors and windows have limited size, 
one wants as much text in these as feasible, provided that its easy to 
read (type not too small, etc.).  The reason is the one often needs to 
refer to the context of the line one is readingc  Using two or more 
windows, monitors, etc. can help too.  I converted my HOWTOs with cat -s 
and I think they read fine.  At any rate, what you've done is going at 
least 99% of the way to what I would have done with cat -s (-:

>Anyhow this is what I have come up with:
>open(FH, "<$ARGV[0]");
>$file = join("", <FH>);
>$file =~ s/\n{4,}/\n/\ngs;
>print $file
I wish you would tell us what kind of script this is.  People reading 
this may not know any scripting language at all.  It looks like you're 
taking any 4 or more contiguous blank lines and making it one blank line.
But I'm only guessing.

                                David Lawyer

To UNSUBSCRIBE, email to ldp-discuss-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org