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

excessive 'newlines'



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

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.

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'm open to suggestions if someone has something better. :)
But I think this will do the trick.

I'll run this on some of the docs (there appears to be about 53) and check
out the results.

Best Regards,
Tim

--
Linux HOWTOs http://linuxdoc.org/HOWTO/


--  
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]