New answers tagged

0

There is a technique called DSU, decorate-sort-undecorate, or the Schwartzian transform. The basic method is to invent your own substitute keys, which can be any combinations of your data (extracted from any parts of your records, perhaps dependant on other fields). These have only to be rankings in the required order of significance. For example, zero-...


0

We can still use sort, in case it's a big file : #!/usr/bin/env bash perl -F'\t' -ne '{$F[1] =~ s/o/,/; $F[4] =~ s/l/t/; print join "\t",@F}' file|\ sort -t $'\t' -k 2,2 -k 5,5 |\ perl -F'\t' -ne '{$F[1] =~ s/,/o/; $F[4] =~ s/t/l/; print join "\t",@F}' The first perl script changes o to , on the second column, l to t on the fifth, to prepare the sort. ...


Top 50 recent answers are included