Bash sort and multi-character tab error
bash, linux, sorting
Solution
The `-t` option expects a single separator character, but you give it two. A way to do what you want would be to consider that the separator is only a single `;`, and thus the third column would become the fifth one:
sort -t ';' -k 5 -r -n -o output.txt input.txt
Problem
I have data in the following form ``` C1510438;;C0220832;;2 C0026030;;C0034693;;1 C1257960;;C0007452;;1 C0061461;;C0027922;;2 C0011744;;C0037494;;3 C0014180;;C0034493;;3 ``` When I try to sort on the 3rd field, the command returns the error ``` sort -t ';;' -k 3 -r -n -o output.txt input.txt sort: multi-character tab `;;' ``` I also try with ``` sort -t $';;' -k 3 -r -n -o output.txt input.txt ``` but the command returns same error. Any idea what to do?