I've been searching high and low for help on this to no avail...

I've imported a MT2.6 export of my blog, which has over 1700 comments (and a similar number of TBs), the majority of which are spam. However, there are also a lot of valuable comments in there which I want to keep and I'd rather not have to go through and mark them all individually.

Looking through this forum, the recommendation is to use SQL to delete comments; this is great for nuking comments indiscriminately, not so good for keeping those that aren't spam. MT comes with lots of great tools for working out whether a comment is spam or not, so how would I apply them to comments already on the system rather than incoming ones?

(I'm a Perl hacker, so happy to dive in and do a little tweaking if someone can point me in the right direction)