On the other hand awk has
1. a variable NR the contains the current line number 2. a % operator that can be used to compute modulo 7 3. a getline command that reads the next line of input
That's all you need.
Cheers, Michael
------------------------------------------------------------------ Michael Doob Telephone: (204) 474-9796 Department of Mathematics email: Michael.Doob@UManitoba.ca University of Manitoba Winnipeg, MB, Canada R3T 2N2 ------------------------------------------------------------------
________________________________________ From: Roundtable roundtable-bounces@muug.ca on behalf of roundtable-request@muug.ca roundtable-request@muug.ca Sent: September 21, 2017 1:23:52 PM To: roundtable@muug.ca Subject: Roundtable Digest, Vol 153, Issue 6
Send Roundtable mailing list submissions to roundtable@muug.ca
To subscribe or unsubscribe via the World Wide Web, visit https://muug.ca/mailman/listinfo/roundtable or, via email, send a message with subject or body 'help' to roundtable-request@muug.ca
You can reach the person managing the list at roundtable-owner@muug.ca
When replying, please edit your Subject line so it is more specific than "Re: Contents of Roundtable digest..."
Today's Topics:
1. Looking for some AWK magic (Wyatt Zacharias) 2. Re: Looking for some AWK magic (Sean Cody) 3. Re: Looking for some AWK magic (John Lange)
----------------------------------------------------------------------
Message: 1 Date: Thu, 21 Sep 2017 12:01:33 -0500 From: Wyatt Zacharias wyatt@magitech.ca To: Continuation of Round Table discussion roundtable@muug.ca Subject: [RndTbl] Looking for some AWK magic Message-ID: CANd2pR2wwERFj2R6_JswyzT91cpnq+RM7KhgC1goP6CEbbJoiQ@mail.gmail.com Content-Type: text/plain; charset="utf-8"
So I've got a storage appliance that I'm trying to generate a growth chart on, but the output format of the statistics is not in a usable format.
The output looks like this, with each day of the week in a column, and then 6 rows of data underneath, and then it repeats. -2- -3- -4- -5- -6- -7- -8- 5827.1 6865.6 3551.2 4649.5 4006.6 15803.5 10305.0 199.4 353.4 175.9 200.7 172.5 584.0 554.2 9.9x 4.4x 6.4x 5.9x 6.3x 5.6x 5.3x 3.0x 4.4x 3.2x 3.9x 3.7x 4.9x 3.5x 29.2x 19.4x 20.2x 23.2x 23.2x 27.1x 18.6x 96.6 94.9 95.0 95.7 95.7 96.3 94.6
-23- -24- -25- -26- -27- -28- -29- 2798.2 2235.3 2357.9 4701.3 9074.3 13796.5 11705.7 86.7 74.1 131.6 178.1 449.3 483.5 473.7 11.4x 12.0x 7.0x 8.1x 3.9x 6.3x 6.7x 2.8x 2.5x 2.6x 3.2x 5.2x 4.6x 3.7x 32.3x 30.2x 17.9x 26.4x 20.2x 28.5x 24.7x 96.9 96.7 94.4 96.2 95.0 96.5 96.0
-30- -31- -1- -2- -3- -4- -5- 2798.6 2274.5 2325.8 2472.1 2526.0 13955.3 11224.2 86.7 88.9 145.2 115.2 105.6 497.9 432.4 10.8x 10.1x 7.4x 8.1x 9.8x 6.2x 6.9x 3.0x 2.5x 2.2x 2.7x 2.4x 4.5x 3.8x 32.3x 25.6x 16.0x 21.5x 23.9x 28.0x 26.0x 96.9 96.1 93.8 95.3 95.8 96.4 96.1
Is there a way I can get awk to process 6 rows of each column at a time?
-- Wyatt Zacharias