Hello Everyone

I am trying to find a way to write out a shell script that will read 2 files. One is an error report file and the other one contains contact information for people. For the start of each line that is found in the error log it will create a file with that account name and send an email to the contact information from the other file using sendEmail.

I have parsed the files but I am not sure how to handle the next part of it and would like some help.

The error file looks like:

Code:
Test Company AACCT00000087 has the below errors:

Error:01000 Cat: 7 SERVER01\Backup of files on C$,D$,System State and Services Database\ADMIN01 The specified service does not exist as an installed service. Found: 2 times



Test Service Andrews Agency  ACCT00000100 has the below errors:

Error:01533 Cat: 7 DESKTOP01\QBW, PST\backup_admin The process cannot access the file because another process has locked a portion of the file. (\\DESKTOP01\C$\Documents and Settings\muffins\archive.pst) Found: 1 times

Error:8473 Cat: 7 CDSK\MyDocs, PST\admin The system cannot find the path specified. (\\SERVER02\C$\Documents and Settings\tiffany\My Documents\*.*) Found: 2 times



Test User    ACCT00000233 has the below errors:

Error:810053 Cat: 2 Software caused connection abort Found: 1 times

Error:41073741703 Cat: 1 SNAP\Backup of files on Landrive\administrator Backup Set not in sync Found: 2 times

Error:81073741763 Cat: 1 Failed to send the files. (crash_database) Found: 8 times
Those are hard returns between each ACCT number and the name (IE Test User) and ACCT are seperated by spaces.

Code:
contact1@domain.com  ACCT00000233 10        CCR01502        Jon Smith
contact2@domain.com  ACCT00000100 11        CCR01544        Andrew Brown
contact3@domain.com  ACCT00000087 11        CCR01544        Janna Green
What I want to do is for the contact email I want to set that as a varible called email. Then set the contact name as variable cname. I know how to match the email address with the ACCT but I don't know how I can achieve sending this all to a place that will have a static body of an email showing the list of errors for each ACCT that is matched. So basically it creates a file then runs a shell command .

File to be created using the customer name and errors.
Code:
Hello $cname

This notification is to let you know that you have the below errors.

[List of errors for acct}
Code:
sendemail -f  myemail@mydomain.com -q \
            -t contactemail \
            -s 127.0.0.1 \
            -o message-file=reportfile \
            -u "Error Report Status ACCTnumber "