From: Niall O Broin (niall at domain magicgoeshere.com)
Date: Wed 24 May 2000 - 12:09:39 IST
On Wed, May 24, 2000 at 11:25:27AM +0100, John P. Looney (Kate) wrote:
> I've a file that for some reason a windows editor has put in double
> newlines everywhere.
> Anyone got a good way of getting rid of them ? I tryed:
> cat file | tr -s \\n
> cat file | sed -e 's/\n\n/\n'
I've just realised that my earlier answer could have been shorter and
perlier - I'll be drummed out of Perl-mongers :-). This works nicely
perl -lne 'print if length' screwed_up_file
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:06:15 GMT