Email Notification

Hi All,

I need write a linux script which emails each record to the employee manager email-id which will be specified inside the file.
Each employee can have a different manager too..

file contain 200 to 300 records

Employee ID,	Employee Name,	Employee Email-ID,	Manager,	Manager Email-ID,	Last Login Date	,Start Date,	End Date,	Employee Status	,Terminated,	Alert Date,	System,	Manager notified

12345	,xxxx	,xxxx@.zzzz.com.au,	yyyyy	,yyyyy@zzzz.com.au	,16/09/2016	,16/09/2016,	16/03/2017	,Contract/Permanent	,Y/N	,16/12/2017	,AD	,16/03/2017

Hi, what have you tried and where are you stuck?

I not able find any example to how to read from a file each record one by one...

Hello tradingspecial,

You could try following.

while read line
do
     echo $line ####This is the Input_file's line(record) do your operation here.
done < "Input_file"

OR(by awk)

awk '{print $0}' Input_file ####We could do any operation inside {} if needed.

Please do let us know if above helps you, if you have more requirements then please be more specific in those. Please share sample Input_file with expected output with all your conditions if any.

Thanks,
R. Singh

Hello tradingspecial,

How is your data formatted? I could guess that it is comma delimited but it would be useful to know for sure. We could then suggest ways to get each field into variables for you to work with later in your script.

Are there always just two header rows and could they be removed? If they are out of a spreadsheet then that's probably too much effort if we know just to ignore two records.

What are you writing your code in? Is is perl, bash, ksh, csh, awk, etc. They each have similar but different ways to do this. If you can show us what you have tried so far then I'm sure we can suggest an adjustment in a way that you can re-use and support in the future.

Kind regards,
Robin