Hi,
I've a file like below:
DeptFile.csv
DeptID EmpID
------- ------
Dep01 Emp01
Dep01 Emp02
Dep01 Emp03
Dep02 Emp04
Dep02 Emp05
I've another file which has
EmpFile.csv
EmpID Salary
------ ------
Emp01 10000
Emp02 12000
Emp03 6000
Emp04 5000
Emp05 15000
Now I need to take the employee who is getting maximum salary in each department. i.e., in Dept01, I need to take employee who is getting max salary (Emp02) and load it into another file in the following format.
DeptID EmpID Salary
I've tried using KSH by taking each record and comparing it with the next file. But since the two csv files (Dept and Emp) are huge in size and it takes more time to execute. Please suggest if any better solution is there to implement this. I use KSH or AWK...
Thanks.