D
deepak p
Hello Perl Gurus,
Can someone show me how to transpose data into a 2 dimensional array.
I searched for examples similar to my need in the newsgroup, but could
not find one thats close :-( I have listed sample data .txt file
below. Assume all data lines are unique and sorted. I appreciate your
time and providing me education.
Kind regards,
Deepak
AAA|a01|BBB|b01|0
AAA|a01|BBB|b02|5
AAA|a01|BBB|b03|2
AAA|a02|BBB|b01|1
AAA|a02|BBB|b02|2
AAA|a02|BBB|b03|2
AAA|a03|BBB|b01|5
AAA|a03|BBB|b02|4
AAA|a03|BBB|b03|2
...
...
Would like output result file to be transposed like.
Res|a01|a02|a03
b01|0|1|5
b02|5|2|4
b03|2|2|2
Later, I need to put it into an html table such as AAA spans
horizontally across 2 table cells of the first row and BBB spans
vertically across the first column.
|AAA|AAA|AAA|
|a01|a02|a03
BBB|b01|0|1|5
BBB|b02|5|2|4
BBB|b03|2|2|2
Can someone show me how to transpose data into a 2 dimensional array.
I searched for examples similar to my need in the newsgroup, but could
not find one thats close :-( I have listed sample data .txt file
below. Assume all data lines are unique and sorted. I appreciate your
time and providing me education.
Kind regards,
Deepak
AAA|a01|BBB|b01|0
AAA|a01|BBB|b02|5
AAA|a01|BBB|b03|2
AAA|a02|BBB|b01|1
AAA|a02|BBB|b02|2
AAA|a02|BBB|b03|2
AAA|a03|BBB|b01|5
AAA|a03|BBB|b02|4
AAA|a03|BBB|b03|2
...
...
Would like output result file to be transposed like.
Res|a01|a02|a03
b01|0|1|5
b02|5|2|4
b03|2|2|2
Later, I need to put it into an html table such as AAA spans
horizontally across 2 table cells of the first row and BBB spans
vertically across the first column.
|AAA|AAA|AAA|
|a01|a02|a03
BBB|b01|0|1|5
BBB|b02|5|2|4
BBB|b03|2|2|2