in reply to How do I append more than one files?

You would open a single file for append/output. You would then, open one input file, read it line by line, and as you read each line, write it back out to the output file. When you reach the end of the first file, you would then close it and open the second input file, and so on. Once you've repeated this process for each input file, you would then close the output file. Don't forget to check return values to ensure that your files are getting opened and closed properly, etc.

You may be able to glean some understanding by reading the documentation for open. Also perlopentut may be helpful.

Take a stab at it, and when you get hung up on some specific part of your implementation of a solution, follow-up to this thread with some specific questions.

The general nature of this website tends to offer help and assistance in learning Perl. Requests for prewritten scripts generally aren't well received. If you're looking for someone to write a complete solution for you, post a job on http://jobs.perl.org.


Dave

  • Comment on Re: How do I append more than one files?