in reply to Compare two Large FlatFiles
From the description you gave this psuedo code may match the problem (yeah, I'm being hesitant)
OK, kidding about the draft pick.if ( file1-field2 eq file2-field5 ) { give me file2-field_to_be_named || first_round_draft_pick }
If this is close to the truth, consider these fragments to work with:
Those snips require a reasonably small subset of the memory needed to do what you described. Perhaps small enough to do the entire task in memory. What they don't do is:my %file1; my %file2; while(<file1>) { my $field_from_1 = (split /<DELIMiTER>/)[1]; $file1{$field_from_1}++; } while(<file2>) { my ($field_from_2, $record_we_want) = (split /<DELIMITER>/)[4,index +_we_cant_guess_from_description]; $file2{$field_from_2} = $record_we_want; } foreach my $keys ( %file2 ) { if ( exists $file1{$key} ) { # do whatever it is they want with $record_we_want } }
Update: destressed some tortured English
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Compare two Large FlatFiles
by suneel.reddy (Novice) on Apr 17, 2012 at 09:25 UTC | |
by suneel.reddy (Novice) on Apr 17, 2012 at 10:02 UTC |