- 论坛徽章:
- 1
|
很菜的写法~- #!/usr/bin/perl -w
- use strict;
- my %hash;
- while (<DATA>){
- chomp;
- my ($name,$non,$inf) = split /\s\s+/,$_;
- push @{$hash{$name}},$inf;
- }
- foreach my $k (sort keys %hash){
- my %h;
- print "$k";
- for my $s (@{$hash{$k}}){
- $h{$s}++;
- }
- foreach my $discribe (sort keys %h){
- print "\t$discribe\t$h{$discribe}";
- }
- print "\n";
- }
- __DATA__
- Contig1 10805 cell culture
- Contig1 5366 spike
- Contig100 38446 root
- Contig100 38446 root
- Contig1001 13750 root
- Contig1001 13750 root
- Contig1002 10216 callus
复制代码 回复 1# wiliiwin
|
|