I have a very large workflow that creates a lookup table. I've gotten it to the point where it has all the details I need to find any value I want, however, it's nearly 100k records in size. The system it is to be used on allows for a default value of "*" that will catch any values after that point. The lookup table could have various numbers of columns - typically 5 or 6. I need to figure out how I cycle through the columns and determine which rows can be eliminated by using a default character. This is an example of what I have:

This is what I'm trying to achieve:

I've gone about this several ways, but keep hitting walls. Any suggestions?
Thanks!
Eric