in reply to Re: Re: Merging 3 files
in thread Merging 3 files

First of all, file1 contains 31 lines, while the other two files contain 33 lines. This might be because the files are actually way bigger and you decided not to post more, or there *is* a difference, and you should check wheter you really want to join these files.

A nice GNU/non-Perlish way would be to do it straight from the command prompt with a few simple commands.
$ nl file2 > f2; nl file3 > f3; join -o 1.5,2.5 f2 f3 | paste file1 -
You might even pipe it to sed to get the formatting done a little nicer, but that's up to you :)

Not a Perl way, but a quick-n-dirty way to get the requested output.
--
b10m

Replies are listed 'Best First'.
Re: Re: Merging 3 files
by duff (Parson) on Dec 18, 2003 at 19:20 UTC
    A nice GNU/non-Perlish way ...
    Not a Perl way ...

    On the contrary, that's exactly a perlish way. Remember, TMTOWTDI includes not using perl (right tool for the job and all that).