in reply to Re: Combine data in table
in thread Combine data in table
# Connect to the database my $dbh = DBI->connect("DBI:CSV:f_dir=.;csv_eol=\n;"); # Associate our csv file with the table name 'results' $dbh->{'csv_tables'}->{'results'} = { 'file' => "file.csv"}; my $row = "IP,Partition,PartitionSize,PartitionFree"; my %ips; foreach my $row (@$row){ $ips{ $row->{colIP} }->{ colPartitionSize } += $row->{colPartitionSi +ze}; $ips{ $row->{colIP} }->{ colPartitionFree } += $row->{colPartitionFr +ee}; } print Dumper \%ips;
Can't use string ("IP,Partition,PartitionSize,Parti") as an ARRAY ref +while "strict refs" in use at ./psfile.pl line 39.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Combine data in table
by davidrw (Prior) on Aug 07, 2005 at 18:09 UTC | |
by DrAxeman (Scribe) on Aug 07, 2005 at 19:10 UTC | |
by davidrw (Prior) on Aug 07, 2005 at 19:30 UTC | |
by DrAxeman (Scribe) on Aug 07, 2005 at 19:49 UTC | |
by davidrw (Prior) on Aug 07, 2005 at 20:19 UTC | |
| |
by DrAxeman (Scribe) on Aug 07, 2005 at 23:25 UTC | |
by davidrw (Prior) on Aug 08, 2005 at 01:19 UTC |