我正在尝试读取一个巨大的CSV文件并将其保存在二维数组中,一定有更好的方法可以在一步中拆分行并将其保存在二维数组中:s
干杯
my $j = 0;
while (<IN>)
{
chomp ;
my @cols=();
@cols = split(/,/);
shift(@cols) ; #to remove the first number which is a line header
for(my $i=0; $i<11; $i++)
{
$array[$i][$j] = $cols[$i];
}
$j++;
}