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 conjuction with the -k command. Since I don't know how many fields the file might have, using the -k command isn't a simple excercice.
The file would look something like this:
1:2:3:
1:1:2:
1:1::
1::1
and the command I am using is
sort -t ':' filename
The most notable thing I am seeing is that it seems to ignore the null values when two delimiters are next to each other. Normally those values would come first in the sort order, but in this case, they are coming last.
The file would look something like this:
1:2:3:
1:1:2:
1:1::
1::1
and the command I am using is
sort -t ':' filename
The most notable thing I am seeing is that it seems to ignore the null values when two delimiters are next to each other. Normally those values would come first in the sort order, but in this case, they are coming last.