Re: Need to Grep only fail count from the Pattern.

2014-07-01 Thread Jim Gibson
On Jul 1, 2014, at 1:26 AM, Uday Vernekar wrote: > The script works fine without > next if $line =~ /^-/; > > How it helps. It skips the line containing all dashes which separate the data lines. The script works without it because that line will fail the next test: ‘next unless scalar @f ==

Re: Need to Grep only fail count from the Pattern.

2014-07-01 Thread Uday Vernekar
The script works fine without next if $line =~ /^-/; How it helps. On Mon, Jun 30, 2014 at 9:06 PM, Jim Gibson wrote: > > On Jun 30, 2014, at 2:44 AM, Uday Vernekar wrote: > > > please Explain > > > > next if $line =~ /^-/; > > “Skip this input line if it starts with a dash ‘-‘ character.” >

Re: Need to Grep only fail count from the Pattern.

2014-06-30 Thread Jim Gibson
On Jun 30, 2014, at 2:44 AM, Uday Vernekar wrote: > please Explain > > next if $line =~ /^-/; “Skip this input line if it starts with a dash ‘-‘ character.” > my @f = split('\s*\|\s*',$line); "Break the input line into files separated by the vertical pipe character ‘|’ and any whitespace

Re: Need to Grep only fail count from the Pattern.

2014-06-30 Thread Uday Vernekar
please Explain next if $line =~ /^-/; my @f = split('\s*\|\s*',$line); next unless scalar @f == 8; On Fri, Jun 27, 2014 at 6:44 PM, Uday Vernekar wrote: > Thanks to allcheers > > > On Thu, Jun 26, 2014 at 10:28 PM, Jim Gibson wrote: > >> >> On Jun 26, 2014, at 2:05 AM, Uday Verne

Re: Need to Grep only fail count from the Pattern.

2014-06-27 Thread Uday Vernekar
Thanks to allcheers On Thu, Jun 26, 2014 at 10:28 PM, Jim Gibson wrote: > > On Jun 26, 2014, at 2:05 AM, Uday Vernekar wrote: > > > Please suggest if any Corrections Needed. > > There are several improvements you could make. > > > > > [code] > > #!/usr/bin/perl > > > > use 5.10.0; > > u

Re: Need to Grep only fail count from the Pattern.

2014-06-26 Thread Jim Gibson
On Jun 26, 2014, at 2:05 AM, Uday Vernekar wrote: > Please suggest if any Corrections Needed. There are several improvements you could make. > > [code] > #!/usr/bin/perl > > use 5.10.0; > use strict; > use warnings; > #Pattern###

Re: Need to Grep only fail count from the Pattern.

2014-06-26 Thread Uday Vernekar
Please suggest if any Corrections Needed. [code] #!/usr/bin/perl use 5.10.0; use strict; use warnings; #Pattern #U/A/S|Test|Test |Loop | Run |Pass |Fail | Arguments # | # |Name |C

Re: Need to Grep only fail count from the Pattern.

2014-06-25 Thread Uday Vernekar
I got it thanks jim :) On Wed, Jun 25, 2014 at 7:12 PM, Jim Gibson wrote: > > On Jun 25, 2014, at 12:11 AM, Uday Vernekar > wrote: > > > Dear Ron, > > You are better off addressing your questions to the entire mailing list, > rather than asking information from one person. Ron is not obligated

Re: Need to Grep only fail count from the Pattern.

2014-06-25 Thread Jim Gibson
On Jun 25, 2014, at 12:11 AM, Uday Vernekar wrote: > Dear Ron, You are better off addressing your questions to the entire mailing list, rather than asking information from one person. Ron is not obligated to help you and may not be available, but others may be willing to help you. > How wud

Re: Need to Grep only fail count from the Pattern.

2014-06-25 Thread Uday Vernekar
Dear Ron, How wud i grep the string | 72| Traffic Test |1| 561| from log file which is Very large. with Regards Uday V G On Tue, Jun 24, 2014 at 8:56 PM, Ron Bergin wrote: > Uday Vernekar wrote: > > Dear All, > > > > Slight Correction Made in Above Code. > > I am grepping

Re: Need to Grep only fail count from the Pattern.

2014-06-24 Thread Ron Bergin
Uday Vernekar wrote: > Dear All, > > Slight Correction Made in Above Code. > I am grepping this Pattern depending on run count which will Always same > Pass count and Fail count will Vary. > | 72| Traffic Test |1| 561| > > [Code] > #!/usr/bin/perl > > use 5.10.0; > use strict; >

Re: Need to Grep only fail count from the Pattern.

2014-06-24 Thread Uday Vernekar
Dear All, Slight Correction Made in Above Code. I am grepping this Pattern depending on run count which will Always same Pass count and Fail count will Vary. | 72| Traffic Test |1| 561| [Code] #!/usr/bin/perl use 5.10.0; use strict; use warnings; my $var=`grep -nr "| 72| Tra

Re: Need to Grep only fail count from the Pattern.

2014-06-24 Thread Uday Vernekar
Dear All, Please correct Me If i am wrong:Here's the code which I wrote [code] #!/usr/bin/perl use 5.10.0; use strict; use warnings; my $var=`grep -nr "| 72| Traffic Test |1| 561| 561| 1| (none)" /tmp/EO-PCPE-23-10GT`; # extract the "failed" field i.e., 6th field my $faile

Re: Need to Grep only fail count from the Pattern.

2014-06-24 Thread Charles DeRykus
On Tue, Jun 24, 2014 at 3:15 AM, Uday Vernekar wrote: > Hi all, > > I tried this its working fine when we have this pattern at hand,but the > pattern is in a log file which is very large and i need to grep this pattern > first from the generated log file then Match.how do i do it? > Once $pattern

Re: Need to Grep only fail count from the Pattern.

2014-06-24 Thread Uday Vernekar
Hi all, I tried this its working fine when we have this pattern at hand,but the pattern is in a log file which is very large and i need to grep this pattern first from the generated log file then Match.how do i do it? with Regards Uday V G On Tue, Jun 24, 2014 at 1:30 PM, Uday Vernekar wrote:

Re: Need to Grep only fail count from the Pattern.

2014-06-24 Thread Uday Vernekar
Thanks everybody will work out the Feasible option from all these..Thanks a lot On Mon, Jun 23, 2014 at 10:12 PM, Charles DeRykus wrote: > On Mon, Jun 23, 2014 at 2:42 AM, Uday Vernekar > wrote: > > Hi All, > > > > > > I have following Pattern from which I need to grep only the Fail count

Re: Need to Grep only fail count from the Pattern.

2014-06-23 Thread Charles DeRykus
On Mon, Jun 23, 2014 at 2:42 AM, Uday Vernekar wrote: > Hi All, > > > I have following Pattern from which I need to grep only the Fail count and > store that in a variable. > > U/A/S|Test|Test |Loop | Run |Pass |Fail| > Arguments > | Name

Re: Need to Grep only fail count from the Pattern.

2014-06-23 Thread Ron Bergin
Uday Vernekar wrote: > Hi All, > > > I have following Pattern from which I need to grep only the Fail count and > store that in a variable. > > U/A/S|Test|Test |Loop | Run |Pass |Fail| > Arguments > | Name |Count|Count|Count|Count | > ---

Re: Need to Grep only fail count from the Pattern.

2014-06-23 Thread Shaji Kalidasan
print Fail and else we print Pass Hope it helps [code] On Mon, Jun 23, 2014 at 8:16 PM, Sunita Pradhan < sunita.pradhan.2...@hotmail.com> wrote: > Can you explain little bit , how this regex will work ? > > -Sunita > > -------------- > Date: Mon,

RE: Need to Grep only fail count from the Pattern.

2014-06-23 Thread Sunita Pradhan
Can you explain little bit , how this regex will work ? -Sunita Date: Mon, 23 Jun 2014 17:12:17 +0530 Subject: Re: Need to Grep only fail count from the Pattern. From: shajiin...@gmail.com To: vernekaru...@gmail.com CC: beginners@perl.org Hi Uday, Here's one way to do it. [code]use stric

Re: Need to Grep only fail count from the Pattern.

2014-06-23 Thread Shaji Kalidasan
Hi Uday, Here's one way to do it. [code] use strict; use warnings; while() { chomp; next if $. <= 3; my($uas, $test, $test_name, $loop_count, $run_count, $pass_count, $fail_count, $arguments) = m/^(.+?)\|(.+?)\|(.+?)\|(.+?)\|(.+?)\|(.+?)\|(.+?)\|(.+?)$/; # my($uas, $test, $test_name, $loop_cou