RE: Help with parsing output

2002-05-31 Thread Kipp, James
On Thursday, May 30, 2002, at 10:42 , Kipp, James wrote: <> very well. i see. > > while () { > next if $_ =~ /USER/; <<# # why not clean the front first and not need a $null # s/^\s+//; my($user,$cpu,$mem,$vmem,$cmd) = split(/\s+/); print ":$user:$cp

RE: Help with parsing output

2002-05-31 Thread Kipp, James
Thanks for the explanation. "Kipp, James" wrote: > > I think that is how he eliminates lines up to the NPROC line. so in other > words, next if range from line 1 to /^NPROC/. and it does work. Yes that is right, I also have to point out a potential problem here This will not work if the first

Re: Help with parsing output

2002-05-31 Thread Sudarsan Raghavan
> < ... > so I fear his (1../^NPROC/) isn't doing quite what he was hoping that > it would be doing >> > > yes, i noticed that, but was easily fixed with minor adjustments I failed to notice this mail, was the adjustment what I had mentioned about swapping the conditions in the if statement.

Re: [Fwd: Re: Help with parsing output] (forgot to post to the list)

2002-05-30 Thread Sudarsan Raghavan
Sudarsan Raghavan wrote: > Original Message > Subject: Re: Help with parsing output > Date: Fri, 31 May 2002 11:07:16 +0530 > From: Sudarsan Raghavan <[EMAIL PROTECTED]> > Organization: HP ISO > To: "John W. Krahn" <[EMAIL PROTECTED]> >

[Fwd: Re: Help with parsing output] (forgot to post to the list)

2002-05-30 Thread Sudarsan Raghavan
Original Message Subject: Re: Help with parsing output Date: Fri, 31 May 2002 11:07:16 +0530 From: Sudarsan Raghavan <[EMAIL PROTECTED]> Organization: HP ISO To: "John W. Krahn" <[EMAIL PROTECTED]> References: <[EMAIL PROTECTED]> <[EMAIL PROTECT

Re: Help with parsing output

2002-05-30 Thread Sudarsan Raghavan
"Kipp, James" wrote: > > > > # INPUTDATA is the filehandle through which you are getting the input > > while () { > > chomp; > > s/^\s+//; > > next if (m/^$/ || (1 .. /^NPROC/)); > > >what does the range thing do? > >wouldn't just ... || /^NPROC/ be enough? > > I think that is how h

Re: Help with parsing output

2002-05-30 Thread bob ackerman
On Thursday, May 30, 2002, at 02:53 PM, bob ackerman wrote: > > On Thursday, May 30, 2002, at 11:20 AM, David Gray wrote: > > while () { > chomp; > s/^\s+//; > next if (m/^$/ || (1 .. /^NPROC/)); what does the range thing do? wouldn't just ... || /^NP

Re: Help with parsing output

2002-05-30 Thread bob ackerman
On Thursday, May 30, 2002, at 11:20 AM, David Gray wrote: while () { chomp; s/^\s+//; next if (m/^$/ || (1 .. /^NPROC/)); >>> >>> what does the range thing do? >>> wouldn't just ... || /^NPROC/ be enough? >> >> ok. opposite sense: || ! /^NPROC/ > > So that wo

Re: Help with parsing output

2002-05-30 Thread drieux
On Thursday, May 30, 2002, at 10:42 , Kipp, James wrote: as for why I do old dog flag tricks - to be honest - they make me feel safer I know that i will not even look at anything, and I get the 'freebie' of not needing to deal with a RegEx resolution - which I think is more expensive - and I

RE: Help with parsing output

2002-05-30 Thread David Gray
> >> while () { > >> chomp; > >> s/^\s+//; > >> next if (m/^$/ || (1 .. /^NPROC/)); > > > > what does the range thing do? > > wouldn't just ... || /^NPROC/ be enough? > > ok. opposite sense: || ! /^NPROC/ So that would be: next if (m/^$/ || ! /^NPROC/); Which means skip proces

Re: Help with parsing output

2002-05-30 Thread John W. Krahn
Sudarsan Raghavan wrote: > > "Kipp, James" wrote: > > > I am reading output from a pipe to a command called 'prstat' (like top). > > just wanted to get some ideas on the best way to capture the data i am > > looking for. below is an example of the output: > > # INPUTDATA is the filehandle throu

RE: Help with parsing output

2002-05-30 Thread Kipp, James
> thanks. question: why the counter in your code example? <> yes, i understand that, i guess the question should have been, why do we need it? why not just do a next unless /REGEX/ then if /$find/ > > hmm..guess i should have scoured the man page before posting the question. > tur

Re: Help with parsing output

2002-05-30 Thread bob ackerman
On Thursday, May 30, 2002, at 09:44 AM, bob ackerman wrote: > > On Thursday, May 30, 2002, at 07:31 AM, Sudarsan Raghavan wrote: > >> "Kipp, James" wrote: >> >>> I am reading output from a pipe to a command called 'prstat' (like top) >>> . >>> just wanted to get some ideas on the best way to c

Re: Help with parsing output

2002-05-30 Thread drieux
On Thursday, May 30, 2002, at 08:04 , Kipp, James wrote: > thanks. question: why the counter in your code example? I presume you mean the '$readIt++' - that is not really a counter, more just a boolean flag We set it to zero and once we see that the /$RightHeader/ we flip it on and get the

RE: Help with parsing output

2002-05-30 Thread Kipp, James
> > # INPUTDATA is the filehandle through which you are getting the input > while () { > chomp; > s/^\s+//; > next if (m/^$/ || (1 .. /^NPROC/)); >what does the range thing do? >wouldn't just ... || /^NPROC/ be enough? I think that is how he eliminates lines up to the NPROC line. s

Re: Help with parsing output

2002-05-30 Thread bob ackerman
On Thursday, May 30, 2002, at 07:31 AM, Sudarsan Raghavan wrote: > "Kipp, James" wrote: > >> I am reading output from a pipe to a command called 'prstat' (like top). >> just wanted to get some ideas on the best way to capture the data i am >> looking for. below is an example of the output: > >

RE: Help with parsing output

2002-05-30 Thread Kipp, James
: drieux [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 30, 2002 10:30 AM To: Kipp, James Cc: Perl Subject: Re: Help with parsing output On Thursday, May 30, 2002, at 06:55 , Kipp, James wrote: > NPROC USERNAME SIZE RSS MEMORY TIME CPU that is the trick throwing away everything before

RE: Help with parsing output

2002-05-30 Thread Kipp, James
Thanks. Clever slice with the split line. -Original Message- From: Sudarsan Raghavan [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 30, 2002 10:31 AM To: Kipp, James Cc: Perl Subject: Re: Help with parsing output "Kipp, James" wrote: > I am reading output from a pipe

Re: Help with parsing output

2002-05-30 Thread Sudarsan Raghavan
"Kipp, James" wrote: > I am reading output from a pipe to a command called 'prstat' (like top). > just wanted to get some ideas on the best way to capture the data i am > looking for. below is an example of the output: # INPUTDATA is the filehandle through which you are getting the input while (

Re: Help with parsing output

2002-05-30 Thread drieux
On Thursday, May 30, 2002, at 06:55 , Kipp, James wrote: > NPROC USERNAME SIZE RSS MEMORY TIME CPU that is the trick throwing away everything before this line, and then doing a basic regEx on the stuff after it: cf: http://www.wetware.com/drieux/pbl/Sys/Admin/prstatFilter.txt persona