Reading 2 CSV files and filtering data based on group

view story

http://www.unix.com – I have two CSV files in the following format: First file: GroupID, PID:TID, IP, Port Sample data: 0,1000:11,,445 0,-1:-1,,800 1,1000:11,,445 1,-1:-1,,900 2,1000:11,,445 2,-1:-1,,900 Second file: IP,Port,PID Sample data,445,1000,800,1000,900,2000 What I need to do is as follows: 1. in the first file, whereever I have PID as -1, I need to pick its IP and port and llok it up in 2nd file and replace the -1 PID with the PID from 2nd file 2. Now based on the groupid (we are sure that there would be exacty 2 r (HowTos)