#!/usr/bin/perl -w

use strict;

my $lbl = "";
my $first = "";
my $cnt = 0;

while (<>) {
    tr/ \t/ /s;
    if (m/^\[([a-z ]+)\] (.*)/i) {
	$lbl = $1;
	$first = $2;
	$cnt = 0;
	#print "$1\n\t$2\n";
    }

    if ($lbl eq "Component") {
	print "$lbl: $first\n";
	next;
    }
    if ($lbl eq "Pin") {
	s/^\|//;
	next if m/^$/;
	my @fld = split;
	my $str = "$fld[0] $fld[1]\n";
	if ($cnt != 0) { print $str; }
	$cnt++;
	next;
    }
}
