Comparing fields in 2 large files
- From: crferry@xxxxxxxxxxxxx (Craig Ferry)
- Date: Wed, 11 Jun 2008 15:20:20 -0400
I am new to perl and would appreciate any suggestions as to how to do
the following.
I have two files, one with 3.5 million records, the other with almost a
million records. Basically here's what I need to do.
See if field_1 in file_a is part of field_1 in file_b
If so, see if field_2 in file_a is part of field_1 in file_b
If so, see if field_3 in file_a is equal to field_2 in file_b
If not equal, write out field_4 in file_a plus field_3 in file_b
I have written a script that will do this, but it runs literally for
days. I'm guessing my method is not the most efficient. I do not
have enough memory to read the files at one time into an array.
Thanks in advance for ideas.
Craig
.
- Follow-Ups:
- Re: Comparing fields in 2 large files
- From: Rob Dixon
- Re: Comparing fields in 2 large files
- Prev by Date: Re: looping 2 times through 5000 differs from 5000 times through 2
- Next by Date: Re: Comparing fields in 2 large files
- Previous by thread: How attach files and send mails on perl????
- Next by thread: Re: Comparing fields in 2 large files
- Index(es):
Relevant Pages
|