declare or otherwise obtain list of files declare scalar for max (a, b) equal to undef for every file{ open the file for reach line{ split the line into scalars (current a, current b) if current a > max a then set max b = current b } close the file } you now have b from the maximum seen value of a