in reply to Sorting based on a specific order

Thanks everyone for your responses! I particularly appreciate a new understanding of the power of map and grep.