Comparing two files
- From: clearguy02@xxxxxxxxx
- Date: Tue, 15 Jan 2008 12:55:56 -0800 (PST)
Hi folks,
I have two files, one with 1000 lines and another with 600 lines and
both files have the user login ID's and the first file has an extra of
400 user id's that I need to find.
Here is the script I have written:
------------------------------------
open (INPUT1,"fullFile.txt") or die "Cannot open the file: $!";
open (INPUT2,"comapreFile.txt") or die "Cannot open the file: $!";
@array1 = <INPUT1>;
@array2 = <INPUT2>;
foreach $word (@array2)
{
if(!grep /$word/i, @array1)
{
print "$_\n";
}
}
----------------------------------------
I am not able to see the output on the screen. Any one sees where I am
doing wrong?
Thanks
J
.
- Follow-Ups:
- Re: Comparing two files
- From: John W. Krahn
- Re: Comparing two files
- From: Jürgen Exner
- Re: Comparing two files
- From: Martijn Lievaart
- Re: Comparing two files
- Prev by Date: Re: How to detect text charset (UTF-8 or Latin-1)
- Next by Date: Re: Comparing two files
- Previous by thread: FAQ 8.14 How do I modify the shadow password file on a Unix system?
- Next by thread: Re: Comparing two files
- Index(es):
Relevant Pages
|