in reply to Suggestions on how to make array of hashes with this...
Do the numbers in the first column matter? They appear to be line numbers in the data file. Using them as array indexes will leave only the 4n+1 ones defined.
Assuming they don't matter, I notice that they are grouped so that the number divided by 4 is the same within a group. Therefore:
This is a pretty direct way to do it, but is tightly bound to your data format.my @aryhash; while (<HANDLE>) { chomp; my @dat = split " ", $_; # magical whitespace split $aryhash[$dat[0]/4|0]->{$dat[2]} = $dat[3]; }
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Suggestions on how to make array of hashes with this...
by snafu (Chaplain) on Sep 21, 2001 at 09:43 UTC |