4

Sort numbers which has colon (:) in between

view full story
linux-howto

http://www.unix.com – Although i tried multiple option i couldn't find a way to get the rigt ouput. Say i have the following data Code: cat file.txt   [1] C request [1:1] [1:4] [1:2] [1:3] [1] C response [2:3] [2] C request [2:1] [2:2] [2] C response The output should look like Code: [1] C request [1:1] [1:2] [1:3] [1:4] [1] C response [2] C request [2:1] [2:2] [2:3] [2] C response I've tried Code: sort -t: -k1,1n -k2,2n or sort -t: +1.1 -1.3 but no luck. any idea? Cheers. Moderator's Comments: (HowTos)