#!/usr/bin/perl

$accum = "";
while (<>)
{
	s/^\s+//;
	s/\s+$//;
	next if (/Files to be transferred:/);
	next if (/Total of \d+ files/);
	if (/Transfer of/)
	{
		$accum = &eatline(2);
		next if ((/succeeded/) &&
			($accum =~ /200 OK/m));
		print "===", $_, "\n", $accum;
		next;
	}
	next if (/PUB/);
	next if (/PRV/);
	next if (/DEL/);
	next if (/Loading (PUB|PRV) seq \d+/);
	next if (/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) +\d+/);
	if (/^Loading \//)
	{
		$loadfile = $_;
		next;
	}
	if (/Start of BRS Load Process/)
	{
		$start = $_;
		next;
	}
	if (/End of BRS Load Process/)
	{
		$end = $_;
		next;
	}
	next if (/^$/);
	next if (/Copyright \(c\) \d+ by Dataware Technologies, Inc./);
	next if (/All rights reserved./);
	next if (/Use by unauthorized persons is a violation of applicable laws./);
	next if (/Revision \d+\.\d+/);
	next if (/Distributed by: Dataware Technologies, Inc./);
	next if (/Licensed To:/);
	next if (/Lansing, MI/);
	next if (/BRS Database Construction Kit/);
	if (/Maximum number of words for a sentence has been exceeded/)
	{
		&eatline(2);
		next;
	}
	next if (/Line \d+ length exceeded \d+ character limit/);
	if (/Maximum number of sentences for a paragraph/)
	{
		&eatline(2);
		next;
	}
	next if (/Loading remaining undersize files/);
	next if (/Documents:/);
	next if (/Words:/);
	next if (/Unchanged words dropped from sort process:/);
	next if (/Unique Words:/);
	next if (/Occurrences:/);
	next if (/Load terminated normally/);

##########################
	print $_, "\n";
}

sub eatline
{
	my $cnt = shift;
	my ($i, $accum);

	for ($i = 0; $i < $cnt; $i++)
	{
		$accum .= <>;
	}

	return $accum;
}
