* SUMMARY: Scripting question
@ 2001-09-25 14:45 Edward Dubrovsky/CGI
0 siblings, 0 replies; only message in thread
From: Edward Dubrovsky/CGI @ 2001-09-25 14:45 UTC (permalink / raw)
To: tru64-unix-managers
Hi Everyone,
I sincerely apologize for the delay in this summary. My original question
was:
> Hi All,
>
> This should be a fairly easy question. I have created a file using awk
> containing a bunch of records from an iostat command output. I am
> filtering
> the idle cpu time via the awk command. Now as you know the first line
> would
> be blank (due to it being originally a date line), the 2nd line is also
> blank since it does not contain column 24 which I filter on (titles), the
> next line would contain the "id" column followed by two lines. The first
> line would be the average to this point and the second line would be the
> actual idle cpu time for this time/second.
>
> What I need to do is filter by every 5th line. Trying to figure out how
to
> grep this?? I was hoping perhaps someone can provide a quick response to
> this little problem.
>
I have received literally tens of answers here is what was basically
recommended:
Since iostat column 24 is the column displaying the CPU idle time, I have
awked columns 24 and only needed every fifth line so I used:
cat iostat.$EXTDATE| awk '{printf $24 "\n"}'|awk 'NR % 5 == 0 {print $0}' >
workfile.$EXTDATE
The second awk is the one I needed.
Thanks to everyone and I do mean everyone for all your insight and answers.
Regards,
Ed.
____
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-09-25 14:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-25 14:45 SUMMARY: Scripting question Edward Dubrovsky/CGI
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox