I assumed your delimiter was \t. Go ahead and change that if I'm wrong.use strict; use warnings; my ($in, $out, %f1); open($in, 'in1.dat'); while (<$in>) { chomp; $f1{$_} = (); } close($in); open($out, '>out.dat'); open($in, 'in2.dat'); while (<$in>) { print $out if !exists $f1{(split /\t/)[0]}; } close($in); close($out);
I'm also assuming you don't have to run this a bunch of times simultaneously. If memory usage is a problem, you can just step through the files one line at a time and compare (since the files appear to be sorted already). But this should be easily doable with a hash, even in Perl.
EDIT: By "this" I meant the task at hand, not walking through the files one line at a time and comparing. Just thought I'd clarify my bad writing :)
In reply to Re: Seeking guidance on how to approach a task
by TedPride
in thread Seeking guidance on how to approach a task
by mark_nelson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |