OMG, using $lines(filename) in the while condition is one of the WORST things u can do!
Each and every time you do $lines(filename) mirc reads the whole file to get the number of lines.
var %x = 1, %file = text.log, %m = $lines(%file)
while (%x <= %m) {
var %line = $read(%file,%x)
if (*<unwanted line>* !iswm %line) { write newfile.txt %line }
inc %x
}
A much nicer solution if it is just a simple !iswm would be.
//filter -ffx sourcefile destinationfile *<unwanted line>*
or
//filter -fwpx sourcefile @destinationwindow *<unwanted line>*
* the -x makes filter exclude the filter matched lines.