

#include <stdio.h>

/* This program takes a file and causes multiple newlines (at least 5)
to become one.
This follows a sed script that removes dates and dash numbers.
sed 's/May 16, 1993//g' | sed 's/^- [0-9]+//g'
*/

main(argc, argv)
int argc;
char *argv[];
{
	int flag, c;
	flag = 0;
	while ((c = getchar()) != EOF)
	{
		if (c == '\n')  flag++;
		else 
		 {if (flag == 1) {flag = 0; putchar('\n'); putchar(c);}
		  else if ((flag >= 2) && (flag<5)) {flag = 0; putchar('\n'); 
			putchar('\n');putchar(c);}
		  else if (flag >= 5) {flag = 0; putchar('\n');
					putchar('-');
					putchar('-');
					putchar('-');
					putchar('-');
					putchar('-');
					putchar('\n');
					putchar(c);}
		  else putchar(c);
		}
	}
}
