I did try that but that seems to treat the entire line as a continuous string.
In other words, if the line was 1:2:3, it doesn't first sort all the 1's together, it instead sorts all the 123's together.
The max number of fields that will be in the file will be 23, so what seems to work is this:
sort -t ':' -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 -k6,6 -k7,7 -k8,8 -k9,9 -k10,10 -k11,11 -k12,12 -k13,13 -k14,14 -k15,15 -k16,16 -k17,17 -k18,18 -k19,19 -k20,20 -k21,21 -k22,22 -k23,23 -o <newfile> <oldfile>...
I am trying to sort a file that could have anywhere from 1-35 different : delimited fields in it. I want it to sort each field independently (not treat the entire line as a single string). However, it seems that the sort command doesn't recognize the -t ':' command unless I use it in...
I am trying to write a query that would return two COUNT values. Basically, I have a table that contains JOBGROUP, JOBNAMES and STATUS. There are many JOBNAMES for each JOBGROUP. The status field can either be SUCCESS or NONE.
So the table looks like this:
JOBGROUP JOBNAME STATUS
A...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.