tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: Edward Dubrovsky/CGI <edward.dubrovsky () cgi ! ca>
To: tru64-unix-managers
Subject: SUMMARY: Scripting question
Date: Tue, 25 Sep 2001 14:45:08 +0000	[thread overview]
Message-ID: <102653680322111.tru64-unix-managers.marc@archive.invalid> (raw)

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.

____

                 reply	other threads:[~2001-09-25 14:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox