title: awk script to print info at specific lines
body: <p>i have some data files, and i need to pull some info out.  i'd like to use a single awk script to get data out, so i can suck some data into bash arrays.</p>
  
  <p>for this, let's assume i need the following (1-indexed):
   - i need awk to print column one on lines 2, 3, and 4
   - i need awk to print columns 1, 2, and 3 on lines 8 and over.  but i want all of the column ones printed before the column twos, and the column twos before the column threes.</p>
  
  <p>using the following data example:</p>
  
  <pre><code>abc
  def
  ghi
  jkl
  mno
  1a1
  2b2
  11 22 33 44
  55 66 77 88
  99 00 12 13
  14 15 16 17
  </code></pre>
  
  <p>i would want awk to print the string:</p>
  
  <pre><code>def ghi jkl 11 55 99 14 22 66 00 15 33 77 12 16
  </code></pre>
  
  <p>i created the following, which i thought would work, but i am getting an error saying "END bocks must have an action part".</p>
  
  <pre><code>awk '
  BEGIN {i=0;}
  {
     if ((NR &gt;= 2) &amp;&amp; (NR &lt;= 4))
        print $1;
     if (NR &gt;= 8)
     {
        col1_arr[i] = $1;
        col2_arr[i] = $2;
        col3_arr[i] = $3;
        i++;
     }
  }
  END
  {
     for (j = 0; j &lt; i; j++)
         print col1_arr[j];
     for (j = 0; j &lt; i; j++)
         print col2_arr[j];
     for (j = 0; j &lt; i; j++)
         print col3_arr[j];
  }' /path/to/my/file
  </code></pre>
  
  <p>thanks ahead of time.</p>