I have a file that goes:
01:12:12:01
WRGHR
zxerty
00:01:02:03
GRAARGH
qwerty
...
00:59:59:01
URRGH
xqwrts
I want to sort this file using one string as the sortable parameter and having the rest be sorted with it.
My current best is:
cat FILE.txt | tr '\n' '\t' | sed -E 's/\t(0[01]:)/\n\1/g' | sort -n | tr '\t' '\n'
This outputs:
00:01:02:03
GRAARGH
qwerty
00:59:59:01
URRGH
xqwrts
...
01:12:12:01
WRGHR
zxerty
which works, but can I do easier that this?
catcan go :-),tr ... < file.txt | ...:-)