use strict; use warnings 'all'; use Text::CSV_XS; my $parser = Text::CSV_XS->new ({sep_char => "\t"}); while () { next if ! length $_; if (! $parser->parse ($_)) { warn "Error parsing: $_"; next; } my @columns = $parser->fields(); next if ! defined $columns[19]; print "$columns[0], $columns[1], $columns[7], $columns[18], $columns[19]\n"; }