in reply to Re: Append Text Files
in thread Append Text Files

That worked BioLion. I don't quite understand the purpose of the second line from the bottom. It appears it goes through each line. Can you explain.
while (<$fh>){ print $merge $_;}
Thanks for your help. Dave

Replies are listed 'Best First'.
Re^3: Append Text Files
by BioLion (Curate) on Oct 09, 2009 at 17:44 UTC

    It is! Basically you are just reading in each of the files to be merged, and printing out each line to the 'merge file'. This is probbaly not the most elegant way of doing this, but it gets the job done.

    I'll add some comments to my rush code to make things clearer...

    Just a something something...
      It is clearer, but I'd like to do something similar to piping in using cat.

        BrowserUk has some good suggestions here. I generally think that one liners or 'elegant' (i.e. short) solutions often involve much obfuscation, so i try to avoid them.

        Wanting to concatenate files is a fairly common desire, and a super search will throw up a good few options. HTH.

        Just a something something...
      I thought so but wasn't sure. I know its pretty easy to do with a Windows batch file. If you know how to make it more elegant, let me know.