in reply to Re^2: Loading of Complex Data Structures
in thread Loading of Complex Data Structures
output:#!/usr/bin/perl use Data::Dumper; my %HoA = (); my %hash_track = (); while(<DATA>) { chomp($_); my (@stuff) = split(" ", $_); &fill(@stuff); } print Dumper(\%HoA); sub fill() { my @a = @_; my @ar = @a[0,1,2,4,5,6,7]; my $h = $a[3]; $HoA{$h}[$hash_track{$h}] = [ @ar ]; $hash_track{$h}++; } __DATA__ 334 Capped 28 5034366 16777215 NULL NULL NULL 373 Capped 28 5034366 16777215 NULL NULL NULL
$VAR1 = { '5034366' => [ [ '334', 'Capped', '28', '16777215', 'NULL', 'NULL', 'NULL' ], [ '373', 'Capped', '28', '16777215', 'NULL', 'NULL', 'NULL' ] ] };
hope this helps,
davidj
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Loading of Complex Data Structures
by davidj (Priest) on Aug 25, 2004 at 21:25 UTC |