Re: don't know where to start??? comparing files

2011-10-18 Thread Zachary Zebrowski
Why don't we just agree to disagree and move on. You both know you have a valid point, and yet there is valid reasons on both sides for having it the way it is, and why in particular environments it's valid to have it one way or the other. On Tue, Oct 18, 2011 at 10:13 AM, Randal L. Schwartz wrot

Re: don't know where to start??? comparing files

2011-10-18 Thread Randal L. Schwartz
> "Shawn" == Shawn H Corey writes: Shawn> On 11-10-14 02:08 AM, Randal L. Schwartz wrote: >> Because this uses*my* environment when I run*your* Perl script. >> That's broken. Shawn> Then you should un-break your environment. I can help you if Shawn> you're using Linux. If you're using Wind

Deployment Issues (Was: don't know where to start??? comparing files)

2011-10-14 Thread Weidner, Ron
> Because this uses *my* environment when I run *your* Perl script. > That's broken. > Hardcode the path. Or install it using any of the module tools, which > will replace #!perl with the proper hardcoded local Perl path. I also view this as a deployment problem which has probably been solved m

Re: don't know where to start??? comparing files

2011-10-14 Thread Shawn H Corey
On 11-10-14 02:08 AM, Randal L. Schwartz wrote: Because this uses*my* environment when I run*your* Perl script. That's broken. Then you should un-break your environment. I can help you if you're using Linux. If you're using Windows, I'm sure there are many on the list who can help. -- Ju

Re: don't know where to start??? comparing files

2011-10-13 Thread Randal L. Schwartz
> "Dermot" == Dermot writes: Dermot> On 13 October 2011 03:07, Randal L. Schwartz wrote: >>> "Shawn" == Shawn H Corey writes: >> Shawn> #!/usr/bin/env perl >> >> Please.  Don't. Dermot> This is quite relevant for me at the moment. I have a couple of Dermot> projects where I will n

Re: don't know where to start??? comparing files

2011-10-13 Thread Igor Dovgiy
May be this'll help? ) #!/usr/bin/perl use strict; use warnings; die 'Usage: ' . __FILE__ . " file1[ file2...]\n" unless @ARGV; my $ref_file = 'ref.txt'; my $new_file = 'new.txt'; open my $ref_fh, '<', $ref_file or die "Failed to open reference file - $!\n"; my %limits_for; while (<$ref_f

Re: don't know where to start??? comparing files

2011-10-13 Thread Dermot
On 13 October 2011 03:07, Randal L. Schwartz wrote: >> "Shawn" == Shawn H Corey writes: > > Shawn> #!/usr/bin/env perl > > Please.  Don't. This is quite relevant for me at the moment. I have a couple of projects where I will not be using the system perl and I was under the impression that u

Re: don't know where to start??? comparing files

2011-10-12 Thread Randal L. Schwartz
> "Shawn" == Shawn H Corey writes: Shawn> #!/usr/bin/env perl Please. Don't. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessage

Re: don't know where to start??? comparing files

2011-10-12 Thread Shawn H Corey
On 11-10-12 10:01 AM, Nathalie Conte wrote: HI All, I have 2 sets of files I want to compare,and I don't know where to start to get what I want :( I have a reference file ( see ref for example) with a chromosome name, a start and a end position Chr7 115249090 115859515 Chr8 25255496 29565459 Chr1

Re: don't know where to start??? comparing files

2011-10-12 Thread Shlomi Fish
Hi Nathalie, On Wed, 12 Oct 2011 15:01:15 +0100 Nathalie Conte wrote: > HI All, > I have 2 sets of files I want to compare,and I don't know where to start > to get what I want :( > I have a reference file ( see ref for example) with a chromosome name, a > start and a end position > Chr7115

don't know where to start??? comparing files

2011-10-12 Thread Nathalie Conte
HI All, I have 2 sets of files I want to compare,and I don't know where to start to get what I want :( I have a reference file ( see ref for example) with a chromosome name, a start and a end position Chr7115249090115859515 Chr82525549629565459 Chr13198276698298299815 Ch

Re: Comparing files with regular expressions

2008-05-05 Thread Rob Dixon
Aaron Rubinstein wrote: > >> Given just the idea of the data, can you improve on that? > > I bet I could! I bet you could too :) > It's interesting how my instinct, when trying to develop a programming > solution, is to wrestle with the problem inside the context of the language. > As a result

Re: Comparing files with regular expressions

2008-05-05 Thread Aaron Rubinstein
> Given just the idea of the data, can you improve on that? I bet I could! It's interesting how my instinct, when trying to develop a programming solution, is to wrestle with the problem inside the context of the language. As a result, the solutions I come up with tend to be shaped by my limited

Re: Comparing files with regular expressions

2008-05-03 Thread Chas. Owens
On Sat, May 3, 2008 at 5:57 PM, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > From: "Chas. Owens" <[EMAIL PROTECTED]> > > > On Sat, May 3, 2008 at 4:42 PM, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > > snip > > > > [stuff about how two arg open is more dangerous than three arg open > > > And that

Re: Comparing files with regular expressions

2008-05-03 Thread Rob Dixon
rubinsta wrote: > Hello, > > I'm a Perl uber-novice and I'm trying to compare two files in order to > exclude items listed on one file from the complete list on the other > file. What I have so far prints out a third file listing everything > that matches the exclude file from the complete file (

Re: Comparing files with regular expressions

2008-05-03 Thread Jenda Krynicky
From: "Chas. Owens" <[EMAIL PROTECTED]> > On Sat, May 3, 2008 at 4:42 PM, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > snip > > > [stuff about how two arg open is more dangerous than three arg open > > And that means you were lucky. If the $file contained something like > > "|rm -rf /" or "rm -rf

Re: Comparing files with regular expressions

2008-05-03 Thread Chas. Owens
On Sat, May 3, 2008 at 4:42 PM, Jenda Krynicky <[EMAIL PROTECTED]> wrote: snip > > [stuff about how two arg open is more dangerous than three arg open > And that means you were lucky. If the $file contained something like > "|rm -rf /" or "rm -rf / |" ... snip Nah, you would be lucky if that wer

Re: Comparing files with regular expressions

2008-05-03 Thread Jenda Krynicky
From: "Chas. Owens" <[EMAIL PROTECTED]> > On Fri, May 2, 2008 at 10:44 AM, rubinsta <[EMAIL PROTECTED]> wrote: > snip > > Any thoughts as to why > > some of the matches are getting missed? > snip > > Not off hand. I will extract your code and do some tests. Can you > send me y

Re: Comparing files with regular expressions

2008-05-02 Thread Chas. Owens
On Fri, May 2, 2008 at 10:44 AM, rubinsta <[EMAIL PROTECTED]> wrote: snip > Any thoughts as to why > some of the matches are getting missed? snip Not off hand. I will extract your code and do some tests. Can you send me your data or is it sensitive? snip > Just out of beginner curiosity, why

Re: Comparing files with regular expressions

2008-05-02 Thread rubinsta
Many thanks, Chas. These are all very helpful (and educational!) suggestions. I adapted your example like so (specifying the all.txt on the command-line): #!/usr/bin/perl use strict; use warnings; open my $ex, "<", "exclude.txt" or die $!; open my $out, ">", "exTest.txt" or die $!; my %exists;

Re: Comparing files with regular expressions

2008-05-02 Thread Chas. Owens
On Thu, May 1, 2008 at 4:09 PM, rubinsta <[EMAIL PROTECTED]> wrote: > Hello, > > I'm a Perl uber-novice and I'm trying to compare two files in order to > exclude items listed on one file from the complete list on the other > file. What I have so far prints out a third file listing everything >

Comparing files with regular expressions

2008-05-02 Thread rubinsta
Hello, I'm a Perl uber-novice and I'm trying to compare two files in order to exclude items listed on one file from the complete list on the other file. What I have so far prints out a third file listing everything that matches the exclude file from the complete file (which I'm hoping will be a d

Re: comparing files

2002-04-12 Thread Jerry Preston
Jenda, I want to which lines are different. Thanks, Jerry Jenda Krynicky wrote: > From: Jerry Preston <[EMAIL PROTECTED]> > > > I want to compare one file to another. Is it better to read the files > > line by line into an array or and hash or what is the best and or > > fastest? These file

Re: comparing files

2002-04-12 Thread Jenda Krynicky
From: Jerry Preston <[EMAIL PROTECTED]> > I want to compare one file to another. Is it better to read the files > line by line into an array or and hash or what is the best and or > fastest? These files are less than 100 lines. Depends on what do you mean by "compare". Do you want to get the

RE: comparing files

2002-04-12 Thread Nikola Janceski
[EMAIL PROTECTED]] > Sent: Friday, April 12, 2002 4:27 PM > To: 'Jerry Preston'; begginners > Subject: RE: comparing files > > > On UNIX it's called diff. >8^P > > > -Original Message- > > From: Jerry Preston [mailto:[EMAIL PROTECTED]] >

RE: comparing files

2002-04-12 Thread Nikola Janceski
On UNIX it's called diff. >8^P > -Original Message- > From: Jerry Preston [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 12, 2002 4:23 PM > To: begginners > Subject: comparing files > > > I want to compare one file to another. Is it better to read

comparing files

2002-04-12 Thread Jerry Preston
I want to compare one file to another. Is it better to read the files line by line into an array or and hash or what is the best and or fastest? These files are less than 100 lines. Thanks, Jerry -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Comparing files

2002-01-29 Thread Jason Purdy
*laugh* - Thanks for the pointers and consider myself better learned. :) Hmm ... now I better go & hunt down all those greps in my scripts... Jason If memory serves me right, on Tuesday 29 January 2002 13:26, Jeff 'japhy' Pinyan wrote: > On Jan 29, Jason Purdy said: > >my ( @filea, @fileb, @in

Re: Comparing files

2002-01-29 Thread Jeff 'japhy' Pinyan
On Jan 29, Jason Purdy said: >my ( @filea, @fileb, @inAButNotInB, @inBButNotInA ); I don't see any hashes being used. This feels like it's going to be very inefficient. >open ( FILEA, shift ) || die "Cannot open 1st file: $!\n"; >@filea = ; >close ( FILEA ); > >open ( FILEB, shift ) || die "C

Re: Comparing files

2002-01-29 Thread Jeff 'japhy' Pinyan
On Jan 29, [EMAIL PROTECTED] said: >1- report any objects in File A that are not in File B >2- report any objects that are in File B but not in File A This sounds like the job for two hashes. It also happens to be in the FAQ under the heading "How do I compute the difference of two arrays? How

Re: Comparing files

2002-01-29 Thread Jason Purdy
Feel like I'm back in comp-sci, but this time, they'll actually let me use a real language (don't get me started on "Turing" ;)). I wrote this simple script that should work with 5.003... Jason #!/usr/bin/perl -w # call this with 2 params, such as # > diff.pl [file1] [file2] use strict; m

Re: Comparing files

2002-01-29 Thread charles
If you are just looking to see if X from file one is in file two, and vice versa, you may want to look at p147 in the Cookbook. It's example is comparing the hash keys of two seperate hashes. If you place each line of your file into a hash and the other file in another hash, and compare the to

Comparing files

2002-01-29 Thread ABhagwandin
I have two lists of objects in two files. I need a way to compare these two files and: 1- report any objects in File A that are not in File B 2- report any objects that are in File B but not in File A 3- Restriction: I am not working with a modern version of Perl, I am restricted to the followin