I took a swing at this in C# since I don't do much Perl.
I put the data into a file and read it in 1 line at a time.
I created a hash table (Dictionary) containing a string as the "key" and a list of strings as the "Value".
As the program loops through the file, it splits the data into parts.
Each group becomes a KEY in the new hash and the name becomes the VALUE.
If the key does not exist, it adds a new key.
If it does exist, it adds a new data row to the key.
That way, ANY groups or names that are added to this are automatically captured.
To display the contents, it can do a double-loop through the keys and data.
Let me know if you want to see the C# code.
Reputation Points: 290
Solved Threads: 277
Posting Virtuoso
Online 1,684 posts
since Oct 2009