mIRC Home    About    Download    Register    News    Help

Print Thread
Numeric sort for @windows #3584 26/12/02 09:36 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline OP
Hoopy frood
OP Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
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.

Re: Numeric sort for @windows #3585 26/12/02 10:15 PM
Joined: Dec 2002
Posts: 699
N
Nimue Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
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

Last edited by Nimue; 26/12/02 10:57 PM.
Re: Numeric sort for @windows #3586 26/12/02 10:24 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline OP
Hoopy frood
OP Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
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?

Re: Numeric sort for @windows #3587 26/12/02 10:34 PM
Joined: Dec 2002
Posts: 699
N
Nimue Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
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"

Re: Numeric sort for @windows #3588 26/12/02 10:40 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline OP
Hoopy frood
OP Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
amazing, thank you smile

Re: Numeric sort for @windows #3589 26/12/02 10:42 PM
Joined: Dec 2002
Posts: 699
N
Nimue Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
You're welcome, glad I could help smile