in reply to Two dimension array from text file
open my $fh, "<", "file_name_here.txt" or die $!; my @data; my $header = <$fh>; while(<$fh>) { chomp; my @row = split "\t"; push @data, [ @row[0, 3, 7] ]; } close($fh) or die $!;
If your TSV is more like a CSV - if it has quoting for example - the you should use Text::CSV_XS instead of split. But if it's just raw data and raw tabs this should work fine.
-sam
|
|---|