Daily Challenge #29

Transposing Data

Given data-table data like below:

A,B,C,D,E,F
G,H,I,J,K,L
M,N,O,P,Q,R
S,T,U,V,W,X
Y,Z,a,b,c,d
e,f,g,h,i,j

transpose data so that columns would become rows like below:

A,G,M,S,Y,e
B,H,N,T,Z,f
C,I,O,U,a,g
D,J,P,V,b,h
E,K,Q,W,c,i
F,L,R,X,d,j

Hints:

  • List of list
  • File
9 Likes

Just FYI, this type of transposition (rotation), can come in handy for like crosswords when you want to generate random words vertically. For this situation, you can rotatate data-table, generate random words horizontally (like this), then rotate data-table back

3 Likes

Hello community,

I noticed that no solution was provide for this. So, below is solution. Notice how input is transposed. I’m using a Label component. That component can be set to hidden (if needed):

8 Likes

Hello everyone, I know this topic is pretty old but its the first time I came across this post on my search for a solution to this very problem (MySQL data not formatted correctly) and this time I really just wanted to let @Hossein know how much of an incredible help you’ve been just by posting this daily challenge and giving me some insight. It didn’t take but 5 more minutes to figure out how to set individual listVariables to the needed index and so on. Anyway… THANKS A MILLION!

4 Likes

@Nathan Glad it helped you out

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.