Live Chat!

Squeeze multiple blank lines to one

* * * * * 2 votos

March 10th, 2007 toydi

Documents like RFCs may contain many blank-line blocks.
To save the trees, i always squeeze multiple blank lines down to single blank line, before printing.
Once I did this manually (yes, it’s like hell), but now I use cat -s:
cat -s rfc2324.txt | tr -d ‘\\f’ | lpr
I use tr -d to remove any form feed character, [...]

Posted in Text Manipulation, cat, lpr, tr | Hits: 11043 | No Comments »