Re: parsing script duplication of lines issue, please advise

2011-07-21 Thread John W. Krahn
Rob Dixon wrote: After these changes, the loop looks like this while (){ chomp; my @line=split(/\t/); if ($line[3] == -1) { print OUT "$_\n"; } } You can make it much simpler than that: while ( ) { print OUT if /\t-1$/; } John -- Any intelligent fool can make

Re: parsing script duplication of lines issue, please advise

2011-07-21 Thread Shlomi Fish
Hi Nathalie, On Thu, 21 Jul 2011 12:00:57 +0100 Nathalie Conte wrote: > HI, > I want to create a simple script where I am parsing a file and writing > only the lines where I can find a certain value in a new output file > this is my Infile format: workable example attached > I want to keep only

Re: parsing script duplication of lines issue, please advise

2011-07-21 Thread Rob Dixon
On 21/07/2011 12:00, Nathalie Conte wrote: HI, I want to create a simple script where I am parsing a file and writing only the lines where I can find a certain value in a new output file this is my Infile format: workable example attached I want to keep only the lines where there is a 1 not the o

Re: parsing script duplication of lines issue, please advise

2011-07-21 Thread Brian Fraser
On Thu, Jul 21, 2011 at 8:17 AM, Nathalie Conte wrote: > I forgot to say that the extra lines are empty... but I don't understand > why they are there :) > > That's rather simpler, since there's nothing in the program that could cause double output (unless you ran it twice :P). The issue is that

Re: parsing script duplication of lines issue, please advise

2011-07-21 Thread Nathalie Conte
I forgot to say that the extra lines are empty... but I don't understand why they are there :) HI, I want to create a simple script where I am parsing a file and writing only the lines where I can find a certain value in a new output file this is my Infile format: workable example attached I wa

parsing script duplication of lines issue, please advise

2011-07-21 Thread Nathalie Conte
HI, I want to create a simple script where I am parsing a file and writing only the lines where I can find a certain value in a new output file this is my Infile format: workable example attached I want to keep only the lines where there is a 1 not the ones with -1, there are 10 in this example