in reply to Re: Perl script for concatenating multiple files in aspecific order listed in a txt file
in thread Perl script for concatenating multiple files in aspecific order listed in a txt file

To do it Perl, read the list file into an array, then loop on the array, open each file listed in turn and print what you read to the same output file.

... and don't forget to chomp off the trailing newlines.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
  • Comment on Re^2: Perl script for concatenating multiple files in aspecific order listed in a txt file

Replies are listed 'Best First'.
Re^3: Perl script for concatenating multiple files in aspecific order listed in a txt file
by Laurent_R (Canon) on Aug 12, 2017 at 17:13 UTC
    Well, chomping the lines from the input files may or may not be necessary. There is no point removing the new lines if the next print statement is just adding them back. So it really depends on what the input files look like.

    It may even not be necessary to read the input files line by line and possibly faster to read 4-kB blocks or so.