RE: Re: Perl code for comparing two files

2009-05-09 Thread Wagner, David --- Senior Programmer Analyst --- CFS
-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 Mr. Adhikary, The following will take

RE: Perl code for comparing two files

2009-05-09 Thread Wagner, David --- Senior Programmer Analyst --- CFS
-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 argument. Then It will check

Re: Perl code for comparing two files

2009-05-09 Thread John W. Krahn
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

Re: Perl code for comparing two files

2009-05-08 Thread Richard Loveland
-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

Perl code for comparing two files

2009-05-04 Thread Anirban Adhikary
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

Problem in comparing two files using compare.pm

2007-08-29 Thread [EMAIL PROTECTED]
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 command

Re: Problem in comparing two files using compare.pm

2007-08-29 Thread Stephen Kratzer
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; } Please find

Re: Comparing two files of 8million lines/rows ...

2006-08-17 Thread Mumia W.
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 (

Re: Comparing two files of 8million lines/rows ...

2006-08-17 Thread Rob Dixon
[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

Re: Comparing two files of 8million lines/rows ...

2006-08-17 Thread JeeBee
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

Re: Comparing two files of 8million lines/rows ...

2006-08-17 Thread Dr.Ruud
[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 entries

Comparing two files of 8million lines/rows ...

2006-08-16 Thread benbart
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

Re: Comparing two files of 8million lines/rows ...

2006-08-16 Thread joseph
[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 EMPNO FROM

Comparing two files

2003-07-22 Thread Cynthia Xun Liu
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,

Re: Comparing two files

2003-07-22 Thread LI NGOK LAM
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, Could anybody help me with the code of comparing files? I have two files : File A: name

Re: Comparing two files

2001-06-09 Thread Will W
, 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 following file 1: red green blue black grey and another file 2: black red

Re: Comparing two files

2001-06-09 Thread subbu cherukuwada
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 said, working with hashes is the way to go: read all of small dataset

Comparing two files

2001-06-06 Thread Steve Whittle
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

Re: Comparing two files

2001-06-06 Thread Ondrej Par
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 (FILE1) { chomp; $found1{$_}++; } and then read second file and compare it: while

Re: Comparing two files

2001-06-06 Thread Bob Mangold
] 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 to a new file. For example, have one file with the following file 1: red green blue black grey

Re: Comparing two files

2001-06-06 Thread Gary Luther
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);