efficient way to write multiple loops code

Hi, I am trying to analyze some data. I have big data files. I have 3 different files in following format. ($file_1, $file_2, $file_3) ID Time IP Code Following is psuedo code which I am writing. I want to know another efficient way to do same thing. open(INFO_1,$file_1); open(INFO_2,$file_2);