Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: whats the best way to query/extract fields from a tab delimited file

by reclaw (Curate)
on Oct 31, 2003 at 20:25 UTC ( [id://303699]=note: print w/replies, xml ) Need Help??


in reply to whats the best way to query/extract fields from a tab delimited file

You could also try using AnyData

use AnyData; my $table = adTie('Tab', 'file.tsv', 'r'); # Get all column Names my @col_names = adNames($table); # or get all values in a column my @col_vals = adColumn($table, 'column_name'); # or get a column value from a row print $table->{row_name}->{column_name}; # or search all rows for a value while (my $row = each %$table) { print $row->{column_name} if $row->{row_name} eq 'this'; } undef $table;

Reclaw

Your mileage may very.

  • Comment on Re: whats the best way to query/extract fields from a tab delimited file
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://303699]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-19 14:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found