I'd like to do a left-to-right sort, instead of top to bottom sort as people normally do. Are there any simple command to this in bash other than transposing the data back and forth? In my opinion, transposing data will add unnecessary complexity to the code.
Here is the input
Carol Adam Dean Bills
0.88 0.57 0.43 0.70
black green white purple
And here is the sorted result based on the data in the first row
Adam Bills Carol Dean
0.57 0.70 0.88 0.43
green purple black white
I don't think this kind of problem is uncommon so I've google and search in this stackoverflow but I couldn't find any simple solutions.