Does the code of your OP, however inelegant it may be, do what you want done? (For instance, I notice that it will never give you the plain 'comp' (no dot) permutation of the master string that your post above seems to require: "It can be a simple, single item ('comp') ..."). If the code does what you want, are you looking for better ways to do the same thing?
If the code does not do what you want, how does the output that is produced differ from the output you want? Please give concrete, concise comparisons.
Your post above mentions data records. Can you give a few concise examples of these records?
Does the code of my previous post do anything to address your concerns? If so, how so? If not, how not?
As it's the weekend, please be patient awaiting responses.