Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Comparison between files and report

by GhodMode (Pilgrim)
on Feb 04, 2006 at 00:23 UTC ( [id://527867]=note: print w/replies, xml ) Need Help??


in reply to Comparison between files and report

Your needs seem pretty clear to me.
my $file1 = "file1.txt"; my $file2 = "file2.txt"; my $file3 = "output.txt"; my $match = 0; # Open the files for reading open( FILE1, $file1 ); open( FILE2, $file2 ); while ( <FILE1> ) { my $string1 = $_; my $string2 = <FILE2>; print "$counter: $string1\n$string2\n\n\n"; ++$match if ( $string1 eq $string2 ); } close FILE1; close FILE2; if ( $match ) { open( FILE3, '> $file3' ); print FILE3 "$match lines matched\n"; close FILE3; }
--
-- GhodMode

Replies are listed 'Best First'.
Re^2: Comparison between files and report
by Anonymous Monk on Feb 07, 2006 at 16:53 UTC
    Thank you,

    That is what I needed.

    Scott

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-03-28 22:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found