9 die "$0: Usage: $0 <directory>\n" unless(@ARGV);
17 opendir(DIR
, "$ARGV[0]") || die "$0: Can't open directory $ARGV[0]\n";
18 while($_ = readdir(DIR
))
20 next unless($_ =~ m
%\
.txt
$% && $_ !~ m
%^_
%);
25 exit if($#files == -1);
29 open(INPUT
, "<$ARGV[0]/$file") || die "$0: Can't open $_: $!\n";
30 $keys{"z-filename"}=1;
42 my($key, $value) = split(/:/, $_, 2);
46 my @elements = split(/\s/, $value);
47 if($spaced && $#elements > 0)
52 $key = $origkey . ($_+1);
53 $rows{$row}{$key} = $elements[$_];
59 $rows{$row}{$key} = $value;
63 $rows{$row}{"z-filename"} = $file;
70 print join("\t", sort(keys(%keys)));
79 if (defined $rows{$_})
81 my %current = %{$rows{$_}};
82 foreach my $column (sort(keys(%keys)))
84 if(defined($current{$column}))
86 print $current{$column};
92 print "\t" unless(scalar(keys(%keys)) == $colcount);