#!/opt/anaconda1anaconda2anaconda3/bin/perl 

eval 'exec /opt/anaconda1anaconda2anaconda3/bin/perl  -S $0 ${1+"$@"}'
    if 0; # not running under some shell

use strict;
use warnings;


my %data;
while (<>) {
    if (/^\#/) {
        print;
        next;
    }
    unless (/\w/) { next; }

    my $line = $_;
    if (/^(comp\d+_c\d+)/) {
        my $comp = $1;
        $data{$comp} .= $line;
    }
    else {
        die "Error, cannot decode component identity from $line";
    }
}

foreach my $component (keys %data) {
    
    print $data{$component} . "\n";

}

exit(0);

