Re: Compare two files

2007-10-05 Thread Jeff Pang
2007/10/5, [EMAIL PROTECTED] [EMAIL PROTECTED]: Hi I would like to compare two files by comparing the files dates. If one file shows ls -la May 12 2003 filename and the other name shows the same date they are OK for me (I'm not interested in the time part only the date of the file) But if

Re: Compare two files

2007-10-05 Thread Jeff Pang
2007/10/5, Jeff Pang [EMAIL PROTECTED]: 2007/10/5, [EMAIL PROTECTED] [EMAIL PROTECTED]: How do I do this in Perl? Hi, if ( int(-M file1.txt) != int(-M file2.txt) ) { # copy the file } Forgot to tell you what's -M in perl,from `perldoc perlfunc`: -M Script start time minus file

Re: Compare two files

2007-10-05 Thread Gunnar Hjalmarsson
Jeff Pang wrote: 2007/10/5, [EMAIL PROTECTED] [EMAIL PROTECTED]: I would like to compare two files by comparing the files dates. If one file shows ls -la May 12 2003 filename and the other name shows the same date they are OK for me (I'm not interested in the time part only the date of the

Re: Compare two files

2007-10-05 Thread Jeff Pang
2007/10/5, Paul Lalli [EMAIL PROTECTED]: On Oct 5, 7:50 am, [EMAIL PROTECTED] (Jeff Pang) wrote: 2007/10/5, [EMAIL PROTECTED] [EMAIL PROTECTED]: I would like to compare two files by comparing the files dates. If one file shows ls -la May 12 2003 filename and the other name shows

Re: Compare two files

2007-10-05 Thread Paul Lalli
On Oct 5, 7:50 am, [EMAIL PROTECTED] (Jeff Pang) wrote: 2007/10/5, [EMAIL PROTECTED] [EMAIL PROTECTED]: I would like to compare two files by comparing the files dates. If one file shows ls -la May 12 2003 filename and the other name shows the same date they are OK for me (I'm not

Re: Compare two files

2007-10-05 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Hi Hello, I would like to compare two files by comparing the files dates. If one file shows ls -la May 12 2003 filename and the other name shows the same date they are OK for me (I'm not interested in the time part only the date of the file) But if the dates are not

Re: compare two files

2005-10-11 Thread Xavier Noria
On Oct 11, 2005, at 11:18, Jeff Pan wrote: Is there a best way to find some lines which exists in both two files? Someone has show me a method but it seems a little low efficiency. The code is as below: Have you searched CPAN for diff modules? -- fxn -- To unsubscribe, e-mail: [EMAIL

Re: compare two files

2005-10-11 Thread John W. Krahn
Jeff Pan wrote: hi, Hello, Is there a best way to find some lines which exists in both two files? Your code logic says that you want to find lines in '2.txt' that are NOT in '1.txt'. Someone has show me a method but it seems a little low efficiency. Not only that but it doesn't work

RE: compare two files

2005-10-11 Thread Bob Showalter
Jeff Pan wrote: hi, Is there a best way to find some lines which exists in both two files? I usually use the Unix comm(1) utility. Its very efficient, but the input files need to be sorted. Google for ppt comm and you can find a Perl version. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: compare two files

2005-10-11 Thread Jeff Pan
Your code logic says that you want to find lines in '2.txt' that are NOT in '1.txt'. thanks for all answerers. yeah,I have put less attention on that code,and have made a fatal logic error. but the way mentioned by John, putting file's all contents to a hash, maybe somewhat less efficiency when