Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: use to files - grep one to eliminate entries from another file.

by Cristoforo (Deacon)
on Jan 24, 2012 at 00:43 UTC ( #949558=note: print w/ replies, xml ) Need Help??


in reply to Re: use to files - grep one to eliminate entries from another file.
in thread use to files - grep one to eliminate entries from another file.

By doing a 'Super Search', (located at the top of any PerlMonks page here), with the words 'find common lines', you will find similiar problems and solutions.

Only, they find lines in common rather than unique. But its not difficult to figure this the difference, I believe.

If the THIDS file isn't too large for your memory, you could read it into a hash to check against the 'mail.fil' for differences.

#!/usr/local/perl-5.12.3/bin/perl use strict; use warnings; open my $THIDS,"<", "THIDSerrs" or die "Could not open 'THIDSerrs' for + reading. $!"; my %data = map {$_ => 1} <$THIDS>; close $THIDS or die "Unable to close 'THIDSerrs' - reading. $!"; open my $mail, "<" , "mail.fil" or die "Could not open 'mail.fil' for +reading. $!"; open my $out, ">", "whatever.dat" or die "Unable to open 'whatever.dat +' for write. $!"; while (<$mail>) { print $out unless $data{$_}; } close $mail or die "Unable to close 'mail.fil' - reading. $!"; close $out or die "Unable to close 'whatever.dat' from writing. $!";


Comment on Re^2: use to files - grep one to eliminate entries from another file.
Download Code
Re^3: use to files - grep one to eliminate entries from another file.
by newkendall (Initiate) on Jan 24, 2012 at 01:04 UTC

    Thanks. I'll work on this tonight

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://949558]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2014-09-19 02:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (129 votes), past polls