I am looking to send a mail message to a large group of users and
indicate which groups they are assigned to. Currently I have a tab
deliniated file which has in column 1 the email address, column 2 the
group, and column 3 the user's name. Using sample data I would like:
s.t.dog@nowhere.com\tFootball\tSpot T. Dog
jon.doe@nowhere.com\tFootball\tJonathon Doe
s.t.dog@nowhere.com\tBaseball\tSpot T. Dog
jon.doe@nowhere.com\tBaseball\tJonathon Doe
jane.doe@nowhere.com\tBaseball\tJane Doe
s.t.dog@nowhere.com\tHockey\tSpot T. Dog
jane.doe@nowhere.com\tHockey\tJane Doe
dick.doe@nowhere.com\tHockey\tRichard Doe
To be formatted like:
s.t.dog@nowhere.com\tBaseball, Football, Hockey\tSpot T. Dog
jon.doe@nowhere.com\tBaseball, Football\tJonathon Doe
jane.doe@nowhere.com\tBaseball, Hockey\tJane Doe
dick.doe@nowhere.com\tHockey\tRichard Doe
...so that I do not have to send multiple emails. I am not sure if I
should be using a hash or an array to accomplish this task. I would
like to know how to loop through the data to pull out the groups for
each email address. It would also be nice if I could sort each group
since some users have over 30+ groups assigned to them.
Any assistance would be greatly appreciated,