我必须打开一个 csv 文件并以哈希的形式给出我的输出。我已经完成了那部分,现在我需要将我的文件的所有内容放入一个变量减去重复项。我怎样才能做到这一点....
open FILE, " < abc.csv" or die $!;
# Reading content from CSV file
my @genes = <FILE>;
# Removing the information header from the CSV file contents
shift (@genes);
print "my %hash = ( \n";
foreach(@genes){
chomp;
my @genes = split(':',$_);
if(@genes != 25){
next;
}
my $amino_acid = join('","',split(/,/,$genes[4]));
print "$genes[2]=> [$genes[0],$genes[1],[$group]],\n";
}