summaryrefslogtreecommitdiff
path: root/Test/filter.pl
blob: c95a7e4f7e275eb3056991d5510a1722c8e4981c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
$numargs = $#ARGV + 1;

($numargs == 2) || die "usage: filter.pl input-log output-log\n";

$input = $ARGV[0];
$output = $ARGV[1];

open(IN, "<$input") || die "can't open $input"; 
open(OUT, ">$output") || die "can't open $output";

my @array = ();

while (<IN>) {
    s/^\s*.:.*\\//;
    s/^Microsoft .*//;
    s/^for Microsoft \(R\) .NET.*//;
    s/^Copyright \(C\).*//;
    if ($_ !~ m/^\s*$/) 		# don't write out blank lines
    {
	push(@array, ($_));
    }
}

#
# if we want to compare only sorted output uncomment this
#@sorted = sort(@array);
@sorted = @array;


#  eliminate duplicates in the output 
$last = "";
foreach (@sorted)
{
    if ($_ ne $last) {
	print(OUT $_);
	$last = $_;
    }
}