I have started learning perl and like to try out new things.
I have some problem in text processing.
I have some text of the form,
0 1 2 3 4 5 6 7 8 9 10
6 7 3 6 9 3 1 5 2 4 6
I want to transpose this text. Like, I want to make rows as columns ans columns as rows. Id there a way to do this in perl?
Thank you all.
So this solution uses an array-of-arrays, each nested array
is a row of data. Very simply you loop over the columns in each
row and push them onto another array-of-arrays using the column
index as the index which to push the value onto. This has the effect
of pivoting the data as you requested.
This results in: