mIRC Home    About    Download    Register    News    Help

Print Thread
/sort to sort lists, with options #6652 15/01/03 11:31 AM
Joined: Jan 2003
Posts: 154
B
BoredNL Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Jan 2003
Posts: 154
/sort will sort a file, -l could be used to sort starting from a line "-l4-", sort everything between lines "-l4-8", and to sort to a certain line "-l-8", and maybe even multiple between lines "-l4-8,12-17,30-".

a "-" at the end of a number would indicate that it is that number and then onward till the end of the file. Just putting the number would indicate to do just the number, and not onward from there.

(if it has multiple between lines specified, then it will treat it like custom format, Ex.:

File.txt contents before the sort:
My first two words are:
Fido
Bone
My second two words are:
Crackers
Dummies

/sort -l2-3,5-6 File.txt
File.txt contents after the /sort command:
My first two words are:
Bone
Crackers
My second two words are:
Dummies
Fido
)

Right now the only way I've figured to sort a file is to create a dialogue with a sorted list in it, then use 'on init' to load a specified file line by line, then to save the all of that to a file, then to close the dialog. That is very very messy though, and It would be very hard for me to add options to that.. I can only use that for "bare bones" files that have nothing but what I want to be sorted in them too..

Also, perhaps an option could be added to make it sort the file a little differently, so that the following won't sort wrong:

1. blah
2. blah
15. blah

so it won't sort to

1. blah
15. blah
2. blah

Perhaps a -n switch to indicate that the file uses a numbered list in at least part of it, and should view the numbers correctly, not just the first part of each number. ( 1 would be viewed as 01 in this instance).

Ok, thanks for reading my request, I hope you add it. smile


- Wherever you go there you are.[color:lightgreen]
Re: /sort to sort lists, with options #6653 16/01/03 12:47 AM
Joined: Dec 2002
Posts: 24
G
GK_Kamel Offline
Ameglian cow
Offline
Ameglian cow
G
Joined: Dec 2002
Posts: 24
/help /filter

Re: /sort to sort lists, with options #6654 16/01/03 05:11 AM
Joined: Jan 2003
Posts: 154
B
BoredNL Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Jan 2003
Posts: 154
Thanks. smile

Sorry about that. I didn't notice that before.. My bad.


- Wherever you go there you are.[color:lightgreen]