Say I have a simple file with tab separated values:
a b c d e f
aa bb cc dd ee ff
A B C D E F
How can I transpose it like a matrix: tabs become newlines and the opposite, to become such:
a aa A
b bb B
c cc C
d dd D
e ee E
f ff F
The lines can be fairly long. I know how to do it in C by reading everything into a 2D buffer and then writing the whole thing out, but I was looking for a simpler solution using shell scripts but couldn't think of anything obvious.