<div dir="ltr">I apologize that this isn't a real answer since you asked specifically about awk; but typically if I'm faced with anything beyond a simple filter, I generally resort to something with a bit more complex processing ability, like perl, or even php. They work great from the command line and it's sooo much easier to process complex data sets. You can even output the results directly into a database or anything else you want.<div><br></div><div>Downside? There really isn't one. Sure, in theory they are slightly "heaver" to invoke than awk, but if you are having to resort to multiple layers of pipes or any other bash trickery, it might actually be more efficient to use perl/php or similar.</div><div><br></div><div>John</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 21, 2017 at 12:22 PM, Sean Cody <span dir="ltr"><<a href="mailto:sean@tinfoilhat.ca" target="_blank">sean@tinfoilhat.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 2017-09-21 12:01, Wyatt Zacharias wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So I've got a storage appliance that I'm trying to generate a growth<br>
chart on, but the output format of the statistics is not in a usable<br>
format.<br>
<br>
The output looks like this, with each day of the week in a column, and<br>
then 6 rows of data underneath, and then it repeats.<br>
<br>
   -2-      -3-      -4-      -5-      -6-       -7-       -8-<br>
5827.1   6865.6   3551.2   4649.5   4006.6   15803.5   10305.0<br>
 199.4    353.4    175.9    200.7    172.5     584.0     554.2<br>
  9.9x     4.4x     6.4x     5.9x     6.3x      5.6x      5.3x<br>
  3.0x     4.4x     3.2x     3.9x     3.7x      4.9x      3.5x<br>
 29.2x    19.4x    20.2x    23.2x    23.2x     27.1x     18.6x<br>
  96.6     94.9     95.0     95.7     95.7      96.3      94.6<br>
<br>
  -23-     -24-     -25-     -26-     -27-      -28-      -29-<br>
2798.2   2235.3   2357.9   4701.3   9074.3   13796.5   11705.7<br>
  86.7     74.1    131.6    178.1    449.3     483.5     473.7<br>
 11.4x    12.0x     7.0x     8.1x     3.9x      6.3x      6.7x<br>
  2.8x     2.5x     2.6x     3.2x     5.2x      4.6x      3.7x<br>
 32.3x    30.2x    17.9x    26.4x    20.2x     28.5x     24.7x<br>
  96.9     96.7     94.4     96.2     95.0      96.5      96.0<br>
<br>
  -30-     -31-      -1-      -2-      -3-       -4-       -5-<br>
2798.6   2274.5   2325.8   2472.1   2526.0   13955.3   11224.2<br>
  86.7     88.9    145.2    115.2    105.6     497.9     432.4<br>
 10.8x    10.1x     7.4x     8.1x     9.8x      6.2x      6.9x<br>
  3.0x     2.5x     2.2x     2.7x     2.4x      4.5x      3.8x<br>
 32.3x    25.6x    16.0x    21.5x    23.9x     28.0x     26.0x<br>
  96.9     96.1     93.8     95.3     95.8      96.4      96.1<br>
<br>
Is there a way I can get awk to process 6 rows of each column at a<br>
time?<br>
<br>
</blockquote>
<br></div></div>
Not particularly... awk is a single line filter, doing multi-line leads to madness.<br>
But you can use the line number to gauge/tract state.<br>
<br>
Crappy awk pseudo code...<br>
<br>
BEGIN {state counter = 0 }<br>
^- { Line starts with ^- it's a header line, set state counter to 0. }<br>
^[0-9]+ & state counter == 0 { next line starts with a number and state counter is 0 so do first line thing, increment state counter }<br>
^[0-9]+ & state counter == 1 { next line starts with a number and state counter is 1 so do second line thing, increment state counter }<br>
...<br>
^[0-9]+ & state counter == 5 { next line starts with a number and state counter is 5 so last line in the sequence, set counter to 0. }<br>
repeat<br>
END { output your fancy stats }<br>
<br>
You can then use a data structure like an array or a 2d matrix to handle the data you output at the end.<br>
<br>
(PS. Yes I know you can nest the stanzas but trying to keep the suggestion clear)<br>
<br>
--<br>
Sean<br>
______________________________<wbr>_________________<br>
Roundtable mailing list<br>
<a href="mailto:Roundtable@muug.ca" target="_blank">Roundtable@muug.ca</a><br>
<a href="https://muug.ca/mailman/listinfo/roundtable" rel="noreferrer" target="_blank">https://muug.ca/mailman/listin<wbr>fo/roundtable</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>John Lange<br><br></div></div></div>
</div>