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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With