| 24 |
rodolico |
1 |
#! /usr/bin/perl -w
|
|
|
2 |
|
|
|
3 |
my @input = <>;
|
|
|
4 |
chomp @input;
|
|
|
5 |
my $lastClient = '';
|
|
|
6 |
#print scalar( @input ) . "\n";
|
|
|
7 |
@headers = split( "\t", shift(@input) ) ;
|
|
|
8 |
foreach my $line (sort @input) {
|
|
|
9 |
@values = split( "\t", $line );
|
|
|
10 |
my %record = map{ $headers[$_],$values[$_] } (0 .. $#values);
|
|
|
11 |
if ( $lastClient ne $record{'# Client'} ) {
|
|
|
12 |
$lastClient = $record{ '# Client' };
|
|
|
13 |
print "#########################################\n";
|
|
|
14 |
print "# " . $record{ '# Client' } . "\n";
|
|
|
15 |
print "#########################################\n";
|
|
|
16 |
}
|
|
|
17 |
foreach my $key ( sort keys %record ) {
|
|
|
18 |
next if $key eq '# Client';
|
|
|
19 |
print $key . ' 'x(10-length($key)) . $record{$key} . "\n" if $record{$key};
|
|
|
20 |
}
|
|
|
21 |
print "\n";
|
|
|
22 |
}
|
|
|
23 |
|
|
|
24 |
|
|
|
25 |
#print join( "\n", @headers );
|
|
|
26 |
|
|
|
27 |
1;
|