mIRC Homepage
Posted By: Online Numeric sort for @windows - 26/12/02 09:36 PM
Since -s performs an alphabetic sort, it would be nice if numeric and descending sort switches were added as well.

Speaking of sorting, and since same people read this and the Bug Reports boards, I'd like to hear if one succeed to use the -u (numeric sort) switch of the /filter command. It just doesn't work.

If file1.txt contains:

3
2
1

and I type /filter -ffu file1.txt file2.txt, file2.txt will come up with same data order. no sorting.
Posted By: Nimue Re: Numeric sort for @windows - 26/12/02 10:15 PM
The -t switch sorts the output based on [c s], column C using character S as the columns separator
--
/filter -fftu 1 1 file1.txt file2.txt * <- to sort 1,2,3,4,
/filter -fftue 1 1 file1.txt file2.txt * <- to sort 4,3,2,1
If there are no 'columns', make up some smile;)

edit-
Added the forgotten "t" switches blush
Posted By: Online Re: Numeric sort for @windows - 26/12/02 10:24 PM
Thanks for your reply, yes, it sorted fine after adding the -t switch followed by '1 1'.

I didn't get the column idea though. can you please show me an example of file column?
Posted By: Nimue Re: Numeric sort for @windows - 26/12/02 10:34 PM
Ok, the "-t 1 1" was because in your sample there were no columns, so I "invented" some. smile

to explain a little more...
file.txt
dataA 1
dataB 2
dataC 3

you want to sort by the values 1,2,3 you would use "-t 2 32" [column 2, seperator 32 ($chr(32))]
to sort by dataX .. "-t 1 32"

file.txt
1:A
2:B
3:C

here if you want to sort by A,B,C it is "-t 2 58"
or to sort by 1,2,3 "-t 1 58"
Posted By: Online Re: Numeric sort for @windows - 26/12/02 10:40 PM
amazing, thank you smile
Posted By: Nimue Re: Numeric sort for @windows - 26/12/02 10:42 PM
You're welcome, glad I could help smile
© mIRC Discussion Forums