you can do this with filter. There's a ton of options but here is a simplistic example:

Create a custom desktop window, and fill some lines like so:
Code
/window -d @test
/aline @test test1
/aline @test test2
/aline @test test3
/aline @test test1


Now use filter to specify in/out both custom windows (-ww), since the out is the same as the in, clear it (c) and exclude any lines matching wildcard *test1* (x)
Code
/filter -wwcx @test @test *test1*


You should be left with two lines, test2 and test3.