Not one machine can do what you are asking. Like what was said earlier you will need a relay and a filter to do what you are asking. A tube has to be in between the relay and filter as the relay will not directly eject out into the filter. Or you can use a chest and a sorting machine set to pull out items automatically.