using a combination of :
- /window
- /loadbuf
- /filter
- /savebuf || $line(@window,N)
is in 99% of the cases the best method to sort large quantities fast and clean in mIRC.
You need to be alitle bit more descriptive in what you want to achieve in order to get a better help reply. Though with the above commands (and the order they are in

) you already might be able to do what you want.
Good luck!