I have a .dat file with three columns separated by spaces [example shown below but in my case there are not column names], and I need to sort the other columns based on the phase column, which is being sorted from least to greatest.
For example,
Time Phase Mag
t1 0.1 m1
t2 0.0 m2
t3 0.2 m3
t4 0.4 m4
t5 0.3 m5
And then sort the three columns like this:
t2 0.0 m2
t1 0.1 m1
t3 0.2 m3
t5 0.3 m5
t4 0.4 m4
I found an example for 2 column data, 2 column sorting example, but it doesn't work for 3 columns. Can someone help me with this?