写一个perl或者Python代码,实现文件信息提取为矩阵形式

2025-04-05 20:25:59
推荐回答(1个)
回答1:

#usr/bin/perl -w
use strict;
my %hash;
open IN , "a.txt" or die $!;
while {
chomp;
$_=~/(ENSG.*?)\t(.*?)(ENSG.*?)\t(.*?)(ENSG.*?)\t(.*?)/;
$hash{$1}=$2;
$hash{$3}=$4;
$hash{$5}=$6;
}
foreach my $key (sort keys %hash)
{
print "$hash{$key}\n";
}