in reply to Re: read files one by one in directory and redirct output to a file (updated)
in thread read files one by one in directory and redirct output to a file

Many apologies for the confusion. Basically what I am trying to do is read the content of all the files in a specific directory and redirect the output to one text file. e.g. 3 small log files.

  • Comment on Re^2: read files one by one in directory and redirct output to a file

Replies are listed 'Best First'.
Re^3: read files one by one in directory and redirct output to a file
by haukex (Archbishop) on Jul 06, 2018 at 12:46 UTC
Re^3: read files one by one in directory and redirct output to a file
by Marshall (Canon) on Jul 08, 2018 at 01:00 UTC
    Basically what I am trying to do is read the content of all the files in a specific directory and redirect the output to one text file. e.g. 3 small log files.

    See my previous post(s). I see no need to "read the content" of the files because you are not doing any processing of the input. Treat them all as binary files and slam them together as a single output file using either "copy" on Windows or "cp" on Unix. If for some reason that doesn't meet your requirements, then give a short example with a couple of dummy files showing the problem. I don't see any "red flags" for performance issues here. But in general reading files line by line in text mode will be much slower than using an O/S command to append all of the files into a single file using a binary mode copy, even considering the overhead of launching the O/S command.