Hello Everyone, I need urgent help here . I need to sort a file for one of my requirement , The file has to be sorted using a key with 4 columns. Sorting is working fine on those 4 columns but when the key is matching for many rows the other columns are also getting sorted which is not required .
Giving an example here : File = Input.txt
1 101 100
1 001 200
1 002 100
Here I am using below command to sort.
Sort -k1,1 -k3 Input.txt
This gives me below output:
1 002 100
1 101 100
1 001 200
I don't want to sort the second column here . I have tried with -s option for stable sort but the same is not supported .
Please help.