while(my $line = <$file>){ chomp $line; # split the line on whitespace, then take certain indexed columns my @columns = (split /\s+/, $line)[10,20,30,32,34,38]; do_stuff_with_those_columns(@columns); }