tashworth has asked for the wisdom of the Perl Monks concerning the following question:
I have a need to convert this string into a two dimensional array.
For instance, I need to convert this:
0 X X X X X X X X 1 X X X X X X X X 2 X X X X X X X X 3 X X X X X X X X 4 X X X X X X X X 5 X X X X X X X X 6 X X X X X X X X 7
Into this:
0 X X X X X X XX 1 X X X X X X
X X 2 X X X X X
X X X 3 X X X X
X X X X 4 X X X
X X X X X 5 X X
X X X X X X 6 X
X X X X X X X 7
In the above instance this happens to be @array 8 x 8 in size, but sometimes it can be more or less. I will be feeding x values (columns) into one for split points and y values into how many rows the array has.
Regards, Tom
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: String to two dimensional array
by BrowserUk (Patriarch) on May 06, 2008 at 22:46 UTC | |
by tashworth (Initiate) on May 06, 2008 at 22:54 UTC | |
by BrowserUk (Patriarch) on May 06, 2008 at 23:03 UTC | |
Re: String to two dimensional array
by pc88mxer (Vicar) on May 06, 2008 at 23:40 UTC | |
Re: String to two dimensional array
by GrandFather (Saint) on May 07, 2008 at 03:02 UTC | |
Re: String to two dimensional array
by kyle (Abbot) on May 07, 2008 at 02:37 UTC | |
Re: String to two dimensional array
by plobsing (Friar) on May 07, 2008 at 08:13 UTC | |
Re: String to two dimensional array
by jdporter (Chancellor) on May 07, 2008 at 12:47 UTC | |
Re: String to two dimensional array
by tashworth (Initiate) on May 07, 2008 at 14:02 UTC |
Back to
Seekers of Perl Wisdom