Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
cooncatenate files line-by-line



dreamreaper
New User

Sep 11, 2007, 10:07 AM


Views: 2823
cooncatenate files line-by-line

I have files such as

File 1:
--------
a quick
jumps over

File 2:
-------
brown fox
the lazy dog

I need a snippet that does the following for me

New File:
----------
a quick brown fox
jumps over the lazy dog

In other words, I want my input files to be read line by line, the contents concatenated and written as a new line to another file. This should be true regardless of the number of input files (i.e. the number of input files is dynamic).

Any help will be greatly appreciated.

Thanks!