in reply to Binary Search
sort file1.csv > file1.sort.csv sort file2.csv > file2.sort.csv comm file1.sort.csv file2.sort.csv
Plus, 61k lines isn't very large at all ... I'm curious as to how you were comparing them originally that you felt was too slow. Maybe your initial algorithm was borked. Could it have been something like
Because that's really slow!open FIRST, "first.csv"; while (my $line = <FIRST>) { open SECOND, "second.csv"; while (my $otherline = <SECOND>) { if ( $line eq $otherline ) { print "Found a match!\n": } } close SECOND; } close FIRST;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Binary Search
by dave_pl (Sexton) on Apr 04, 2005 at 14:01 UTC | |
by dragonchild (Archbishop) on Apr 04, 2005 at 14:16 UTC |