Even shorter :-) (Update: Sorry, not quite the same, see replies.)
$ perl -lp000e1 input.txt >output.txt
In reply to Re^3: replace multiple newline characters
by haukex
in thread replace multiple newline characters
by g_speran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |