mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-18 02:22:27 +02:00
36048db468
- boom/count.pl: count characterized parts, with type and manufacturer breakdown - boom/Makefile (count): new target to run count.pl
20 lines
287 B
Perl
Executable File
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";
|
|
}
|
|
}
|