freekngeek has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I have a text file, from which I have parsed some strings like this :
Now, I want to split this string and want to store it in nested hash..Like thisLB split2 1e38 split1 -0.43092 + (4.788 * W) M2 split2 L < 10 AND W < 1.080 split1 (-0.665364 + (9.6216 * W))*(10/L +) split1 -1.38618 + (20.045 * W) split2(L < 10 AND W >= 1.080) OR (L +>= 10 AND W > 0)split1 -0.665364 + (9.6216 * W) split1 -1.38618 + (20 +.045 * W) M1 split2 L < 10 AND W < 1.080 split1 (-0.665364 + (9.6216 * W))*(10/L +) split1 -1.38618 + (20.045 * W) split2(L < 10 AND W >= 1.080) OR (L +>= 10 AND W > 0)split1 -0.665364 + (9.6216 * W) split1 -1.38618 + (20 +.045 * W)
<>%metals = ( # $metal-level1 ==> { # LENGTH_RANGES ==> @length(L1,L2) # WIDTH_RANGES ==> @width(W1) # EM_POLY ==> {
LB, M1 and M2 are metal lines and then I have width and length of metals and polynomial equations. I have extract all these values and stored in arrays, But as I am new to perl, So, I couldn't figured out that how can I store those values in 3D hash structure. I am using these keywords split1, split2 to split the string into different arrays for length, widths and so on.
I am not asking for a solution, but just an idea that how can I make a 3d hash structure for the given text. Thanks
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Multidimentional hash
by hdb (Monsignor) on Jul 01, 2013 at 16:00 UTC | |
Re: Multidimentional hash
by roboticus (Chancellor) on Jul 01, 2013 at 16:09 UTC | |
Re: Multidimentional hash
by QM (Parson) on Jul 01, 2013 at 16:09 UTC | |
Re: Multidimentional hash
by RichardK (Parson) on Jul 01, 2013 at 16:16 UTC |
Back to
Seekers of Perl Wisdom