mIRC Homepage

/sort to sort lists, with options

Posted By: BoredNL

/sort to sort lists, with options - 15/01/03 11:31 AM

/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
Posted By: GK_Kamel

Re: /sort to sort lists, with options - 16/01/03 12:47 AM

/help /filter
Posted By: BoredNL

Re: /sort to sort lists, with options - 16/01/03 05:11 AM

Thanks. smile

Sorry about that. I didn't notice that before.. My bad.
© 2020 mIRC Discussion Forums