in reply to Re: How do I Extract contents from given input files and merge into one text file based on Unique keys present in input files
in thread How do I Extract contents from given input files and merge into one text file based on Unique keys present in input files

lnin,

bart above really does have the answer to this question. You can't easily read data and then immediately write data any way you please. To write the data column-wise or anyway-wise, it's best to:

Given that you are wanting to write out the data in terms of iterations and line numbers, the data can be stored in an array (as pairs of numbers, for example). The index to the array can be the number of the iteration.
  • Comment on Re^2: How do I Extract contents from given input files and merge into one text file based on Unique keys present in input files