Wagner, David --- Senior Programmer Analyst --- CFS wrote:
-Original Message-
From: Anirban Adhikary [mailto:anirban.adhik...@gmail.com]
Sent: Monday, May 04, 2009 06:40
To: beginners@perl.org
Subject: Perl code for comparing two files
Hi List
I am writing a perl code which will takes
> -Original Message-
> From: Anirban Adhikary [mailto:anirban.adhik...@gmail.com]
> Sent: Monday, May 04, 2009 06:40
> To: beginners@perl.org
> Subject: Perl code for comparing two files
>
> Hi List
> I am writing a perl code which will takes 2 more files as
&g
> -Original Message-
> From: news [mailto:n...@ger.gmane.org] On Behalf Of Richard Loveland
> Sent: Friday, May 08, 2009 11:59
> To: beginners@perl.org
> Subject: Re: Perl code for comparing two files
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Mr. Adhikary,
The following will take any number of files as arguments, in the format
you described (I even tested it! :-)). It goes through each line of
those files, stuffing (the relevant part of) each line in a 'seen' hash
(more on that, and other,
Hi List
I am writing a perl code which will takes 2 more files as argument. Then It
will check the the values of each line of a file with respect with another
file. If some value matches then it will write the value along with line
number to another ( say outputfile) file.
The source files are as
On Wednesday 29 August 2007 00:43:52 [EMAIL PROTECTED] wrote:
> Hi,
>
> Please find below my code to compare 2 files
> "source.txt,destination.txt" in folder "seek"
>
> #!perl
>
> use File::Compare;
>
> if(Compare("source.txt","destination.txt")==0)
> {
> print "They're equal\n";
>
Hi,
Please find below my code to compare 2 files
"source.txt,destination.txt" in folder "seek"
#!perl
use File::Compare;
if(Compare("source.txt","destination.txt")==0)
{
print "They're equal\n";
}
Please find below the error I am getting while running the code in
co
[EMAIL PROTECTED] schreef:
> SELECT EMPNO FROM EMP WHERE EMPNO NOT IN ( SELECT EMPNO
> FROM [EMAIL PROTECTED] )
Or maybe use something like
select EMPNO as E1 from EMP left join [EMAIL PROTECTED] as E2 on E1.EMPNO =
E2.EMPNO where E2.EMPNO IS NULL
(untested)
> So search FILE1 for all line entri
Just an idea, don't know whether it's useful...
If you can get both files sorted (either by adding order to your sql
query that generates the file, or the commandline 'sort') the problem
becomes much more easy.
You'd just have to traverse each file, something like this:
read word_1 from file_1
rea
[EMAIL PROTECTED] wrote:
>
> I have two database tables, one is local and one is on a WAN. They are
> supposed to be in-sync but they at the moment, they are not. There are
> 8million+ plus rows on this table.
>
> I tried to do SELECT EMPNO FROM EMP WHERE EMPNO NOT IN ( SELECT EMPNO FROM
> [EMAIL
On 08/16/2006 04:35 PM, [EMAIL PROTECTED] wrote:
Hi all,
I have two database tables, one is local and one is on a WAN. They are supposed
to be in-sync but they at the moment, they are not. There are 8million+ plus
rows on this table.
I tried to do SELECT EMPNO FROM EMP WHERE EMPNO NOT IN ( SELE
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
Hello,
>
> I have two database tables, one is local and one is on a WAN. They are
> supposed
> to be in-sync but they at the moment, they are not. There are 8million+
> plus
> rows on this table.
>
> I tried to do SELECT EM
Hi all,
I have two database tables, one is local and one is on a WAN. They are supposed
to be in-sync but they at the moment, they are not. There are 8million+ plus
rows on this table.
I tried to do SELECT EMPNO FROM EMP WHERE EMPNO NOT IN ( SELECT EMPNO FROM
[EMAIL PROTECTED] ), leave that runni
been tested.
2. I suppose your line format is exactly same as you provided.
HTH
- Original Message -
From: "Cynthia Xun Liu" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 22, 2003 11:15 PM
Subject: Comparing two files
> Hi,
>
>
Hi,
Could anybody help me with the code of comparing files? I have two files
:
File A: name, info1, info2...
FileB: name, info1, info2...
I want to print out all the lines in File A with the same names as in
File B.
Thanks.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e
MAIL PROTECTED]>
>To: "Steve Whittle" <[EMAIL PROTECTED]>,
><[EMAIL PROTECTED]>
>Subject: Re: Comparing two files
>Date: Sat, 9 Jun 2001 07:35:05 -0700
>
>If your system's memory is large enough to hold the smaller dataset,
>then as others have sai
TED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 06, 2001 8:46 AM
Subject: Comparing two files
> Hi,
>
> I'm trying to write a script that removes duplicates between two files
and
> writes the unique values to a new file. For example, have one file
with the
> followin
Unless I am missing the point of the question, this seems to
me like an Intersection of Arrays problem which is covered in every Perl book
that I have seen under hashes.
Basically:
%seen=();
foreach (@array1) {
$seen($_)=1;
}
$intersection=grep($seen($_), @array2);
BgRAgAG
> BQI6+tEnAAoJEDDNAitGCH7xa7AAn0dybVrFf+QHtfgkAsRK3oXY+7gwAJ4sWtYC
> GuYw+8LgdC7Mp2ICim9MqA==
> =iAF5
> -END PGP PUBLIC KEY BLOCK-
> =cut
>
>
> - Original Message -
> From: "Steve Whittle" <[EMAIL PROTECTED]>
> Date: Wednesday, June 6, 2001 11:46
Hi,
one approach is to sort that files first, and work with sorted files - you
then need to read them only once.
Second approach is to load smaller file into memory - to create a has with
something like
while () { chomp; $found1{$_}++; }
and then read second file and compare it:
while () {
-
=cut
- Original Message -
From: "Steve Whittle" <[EMAIL PROTECTED]>
Date: Wednesday, June 6, 2001 11:46 am
Subject: Comparing two files
> Hi,
>
> I'm trying to write a script that removes duplicates between two
> files and
> writes the unique values
Hi,
I'm trying to write a script that removes duplicates between two files and
writes the unique values to a new file. For example, have one file with the
following file 1:
red
green
blue
black
grey
and another file 2:
black
red
and I want to create a new file that contains:
green
blue
grey
22 matches
Mail list logo