Hi,
i want to sort a file by column 2, 3, 10 and 4(in this order), can anybody help me? thanks a lot.
Hi,
i want to sort a file by column 2, 3, 10 and 4(in this order), can anybody help me? thanks a lot.
Check out the sort command ( $ man sort ) - especially the sort key options. You can sort on position or on a character separator. Multiple keys are allowed but this would take some thinking to get the order correct.
When you say columns, I assume you mean columnized data separated by white space, instead of character positions. If so, this should work:
sort -k2b,2 -k3b,3 -k10b,10 -k4b,4 myfile