Brian Candler wrote:
> luisbebop wrote:
>   
>> I did a single line of code in Ruby, which joins all text files in a
>> folder to a bigfile. I got some tests, and it's works!
>> Does anyone knows a better way, or other 'Ruby Way' to do that ?
>>
>> File.open('bigfile','w') { |mergedFile| Dir.glob("*.txt").each { |
>> file| File.readlines(file).each { |line| mergedFile << line } } }
>>     
>
> system("cat *.txt >bigfile")
>   

and on Windows
system("copy *.txt > bigfile")
(make sure that the bigfile name doesn't match the pattern, so use 
bigfile rather than bigfile.txt)

Cheers,
Mohit.
10/26/2008 | 5:49 PM.