robertkraus has asked for the wisdom of the Perl Monks concerning the following question:
And I need it infoo1 1 4 7 foo2 2 5 8 foo3 3 6 9
That is, in column one are the identifiers, and the numbers following from the 2nd column are its values. Obviously I have to read in the whole table and then print column one followed by its values in column 2, then print column 1 again, followed by its values in column 3, and so forth. After some searching it seems that I need to build a hash of arrays, and from that call the data from a loop? However, as I said, I usually do text manipulations line by line, and what I found so far was rather confusing. I hope someone can help me here. Cheers, Robertfoo1 1 foo2 2 foo3 3 foo1 4 foo2 5 foo3 6 foo1 7 foo2 8 foo3 9
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Stack table columns with hash of arrays
by davido (Cardinal) on May 31, 2011 at 08:35 UTC | |
by robertkraus (Novice) on May 31, 2011 at 09:05 UTC | |
by Anonymous Monk on May 31, 2011 at 12:05 UTC | |
by davido (Cardinal) on May 31, 2011 at 16:08 UTC | |
by Anonymous Monk on Jun 01, 2011 at 11:52 UTC | |
|
Re: Stack table columns with hash of arrays
by jwkrahn (Abbot) on May 31, 2011 at 09:08 UTC | |
by robertkraus (Novice) on May 31, 2011 at 09:27 UTC | |
|
Re: Stack table columns with hash of arrays
by ikegami (Patriarch) on May 31, 2011 at 07:58 UTC | |
by robertkraus (Novice) on May 31, 2011 at 08:19 UTC | |
|
Re: Stack table columns with hash of arrays
by Marshall (Canon) on May 31, 2011 at 09:49 UTC |