Want to read

I have a input file like above some times it’s having the more email id columns accordingly where I found the header n emailid in master file i have to pick that row value can any one help me on it