Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Merging Many Files Side by Side

by atemon (Chaplain)
on Feb 19, 2009 at 20:36 UTC ( [id://745188]=note: print w/replies, xml ) Need Help??


in reply to Merging Many Files Side by Side

Hi,

Try CPAN module Tie::File
It says:

Tie::File represents a regular text file as a Perl array. Each element in the array corresponds to a record in the file. The first line of the file is element 0 of the array; the second line is element 1, and so on.

The file is not loaded into memory, so this will work even for gigantic files.

Changes to the array are reflected in the file immediately.

Important fact is, file is never loaded into memory. You can tie all your files including 'result file' and write to 'result file' without loading neither of them to memory. Writing to new file would be just a push to array tied to result file.
Hope this helps.

Cheers !

--VC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://745188]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-03-29 11:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found