in reply to Re^3: a one-liner for this trivial problem?
in thread a one-liner for this trivial problem?
($small_file, $big_file) = @ARGV; open SMALL, $small_file; while(<SMALL>) { $id_to_remove=$_; chomp $id_to_remove; $hash_to_remove{$id_to_remove} = $id_to_remove; } close SMALL; open BIG, $big_file; while(<BIG>) { $id_to_check=$_; chomp $id_to_check; if(not exists $hash_to_remove{$id_to_check}) {print $id_to_check."\n";} } close BIG;
|
|---|