Tuesday, November 11, 2008

Splitting columns in Perl

Splitting columns or fields is one of the most common tasks. Among the many ways to split columns in perl, the best and the simplest way is
Suppose if we want to split 4th field, where the field separator is tab
while() {
chomp;
my $var=(split /\t+/)[3];
}

No comments: