First thanks for your reply.
The example I gave is very shortly. The size of the input files might be change and might be big, so i guess it might influence the memory ?
azaria
In that case I wouldn't slurp in the files all at once. My solution is one that doesn't, copes with a different number of lines per file, and with an arbitrary number of files passed on the cmd line. Shameless self ad terminated! ;-)