mIRC Home    About    Download    Register    News    Help

Print Thread
sort output from word.txt #128350 24/08/05 01:57 AM
Joined: Jan 2003
Posts: 39
Q
quiglag Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Jan 2003
Posts: 39
So i have a word.txt file like this :
--------word.txt-----
a horse
b cow
c bird
b dog
c cat
a rabbit
----------------
and i want to output them with them in alphabetical order by the letter before main word. Ex horse, rabbit, cow, dog, bird, cat

Is this possable? Can you give me a quick example script of how to do this.

Thanks

Re: sort output from word.txt #128351 24/08/05 05:54 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
/help /filter

Since I dont know where you want to output to!

;sorts the word.txt file itself
/filter -ffct 1 13 word.txt word.txt *

-- OR --

;Assuming you want to output to custom window @output
//filter -fwt 1 13 word.txt @output *

Re: sort output from word.txt #128352 25/08/05 09:35 AM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
/filter -ffca word.txt word.txt also sorts the default way, if you don't specify a sorting alias. A bit easier to remember, if you just want an alphanumeric sorting in ascending order.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: sort output from word.txt #128353 25/08/05 12:48 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
yeah, i just thought it might be nice to show the -t since it does lend alot more sorting power to filter, even if the one i showed was pretty well pointless :-)