I have written a ConsoleTools library for these kind of filtering tasks, if the required setup is worth it to you.