mIRC Home    About    Download    Register    News    Help

Print Thread
put lines in a text file in a specific order #120460 17/05/05 08:41 PM
Joined: May 2005
Posts: 6
J
Jonkka Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
J
Joined: May 2005
Posts: 6
I have no idea if this is possible at all, but I'll ask here anyway smile
I have a textfile containing a nick and a number like this:

nick1 13
nick2 4
nick3 17

and so i would like something that would organize the file so that the one with highest number would be on first line in the text file and so on. But is it possible to do such a thing with mirc script and a text file or should I use some other method for this?

Re: put lines in a text file in a specific order #120461 17/05/05 09:21 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Suppose you had those nicks with their according score in a file called score.txt, located in your main mIRC folder. All it takes to sort those based on their score, in descending order is the issuing of the /filter command like this:

/filter -ffctue 2 32 score.txt score.txt


Gone.
Re: put lines in a text file in a specific order #120462 21/05/05 05:37 PM
Joined: Mar 2005
Posts: 18
A
adazh Offline
Pikka bird
Offline
Pikka bird
A
Joined: Mar 2005
Posts: 18
How to do this alphabetically? I look at the switches in help but it explains not very well.

Re: put lines in a text file in a specific order #120463 21/05/05 06:22 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
leave off the ue in the /filter command...the u makes it a numeric sort, the e makes it in descending order.
For an alphabetic sort (A - Z) just leave off those two switches, although you'll have to change what you're sorting by, as the original was looking at the numbers

Re: put lines in a text file in a specific order #120464 25/05/05 07:03 PM
Joined: May 2005
Posts: 1
B
Berry975 Offline
Mostly harmless
Offline
Mostly harmless
B
Joined: May 2005
Posts: 1
and how about an ini file? if i want to sort this file it doesnt quite do what it must be frown
the ini file looks like this :
[Words]
Berry975=50
Berry974=14000
Berr976=1
Berry977=1587

How can i sort this in a new file bij most words first?