1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-25 17:31:51 +02:00
eda-tools/boom/count.pl
Werner Almesberger 36048db468 Added more detailed part counting.
- boom/count.pl: count characterized parts, with type and manufacturer
  breakdown
- boom/Makefile (count): new target to run count.pl
2010-10-17 16:19:49 -03:00

20 lines
287 B
Perl
Executable File

#!/usr/bin/perl
$tot = 0;
while (<>) {
next unless /\bT=(.+?)\b/;
$tot++;
$c = $1;
$cat{$c}++;
/^\s*(\S+)\s/;
$man{$c}{$1}++;
}
print "Total: $tot\n";
for $c (sort keys %cat) {
print " $c: $cat{$c}\n";
for $m (sort keys %{ $man{$c} }) {
print "\t$m: $man{$c}{$m}\n";
}
}