in reply to reading file in Hash
gives the output...#!/usr/bin/perl use strict; use Data::Dumper; use Data::CTable; my $table = Data::CTable->new("data.txt"); $table->clean_ws(); # a bit of a clean up my $fields = $table->fieldlist_all(); my %final_hash; foreach my $col ( @$fields ) { $final_hash{$col} = $table->{$col} ; ## Get a column you know + exists } print Dumper \%final_hash;
$VAR1 = { '1' => [ 'a', 'b', 'c' ], '3' => [ 'x', 'y', 'z' ], '2' => [ 'p', 'q', 'r' ] };
perliff
"with perl on my side"
|
---|