#! /usr/bin/perl # $Cambridge: exim/doc/doc-docbook/Tidytxt,v 1.1 2005/06/16 10:32:31 ph10 Exp $ # Script to tidy up the output of w3m when it makes a text file. We convert # sequences of blank lines into a single blank line. $blanks = 0; while (<>) { if (/^\s*$/) { $blanks++; next; } print "\n" if $blanks > 0; $blanks = 0; print; } # End