I have a student csv file containing fields with student data and the mailadress of the teacher in charge at the end. I try to automatically send only one email to the teacher containing all his students (using sendemail). The mail part is no problem but i cannot get the data out of the csv they way I want it. The csv file is created daily and contains a different number of students every day.
aer,kdx,mail1 dke,kad,mail2 err,qqq,mail1 qpi,bcc,mail1 bkd,onk,mail2 kcc,mnb,mail3
I tried to use awk and put all lines containing the same mailadress in an array but failed with that approach.
In this example it should send 3 mails. First containing
aer,kdx err,qqq qpi,bcc
Thanks for any hints