in reply to whats the best way to query/extract fields from a tab delimited file
you might also want to use chomp().use strict; my $filename = 'test.tsv'; open (FILE, $filename); my @headers = split(/\t/,<FILE>); while (my $line = <FILE>) { my @fields = split(/\t/,$line); } close (FILE);
An (somewhat more complex) alternative is to use DBI and DBD::CSV.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: whats the best way to query/extract fields from a tab delimited file
by aussieaubs (Initiate) on Oct 31, 2003 at 19:50 UTC |