title: Reading columnar data -- better approach than var1=$(cat|awk); var2=$(cat|awk), etc?
body: <p>What's a more elegant way of declaring multiple variables from awk outputs? I have two files that are auto-generated. The files can have as many as three lines. Here's a sample of the variable declarations that I did so far:</p>
  
  <pre><code>$ cat OUTF1.tmp
          25          16      8.33 VERY GOOD
          12          17        25 OK
  $ cat OUTF2.tmp
          30          60      15.38 VERY GOOD
  </code></pre>
  
  <hr>
  
  <pre><code>TMP1="OUTF1.tmp"
  TMP2="OUTF2.tmp"
  </code></pre>
  
  <hr>
  
  <pre><code>MATH_101=$(cat $TMP1 | awk 'NR==1{print $1}' )
  ENGLISH_101=$(cat $TMP1 | awk 'NR==1{print $2}' )
  SCIENCE_101=$(cat $TMP1 | awk 'NR==1{print $3}' )
  GRADE_101=$(cat $TMP1 | awk 'NR==1{print $4}' )
  
  MATH_102=$(cat $TMP1 | awk 'NR==2{print $1}' )
  ENGLISH_102=$(cat $TMP1 | awk 'NR==2{print $2}' )
  SCIENCE102=$(cat $TMP1 | awk 'NR==2{printf $3}' )
  GRADE102=$(cat $TMP1 | awk 'NR==2{print $4}' )
  
  MATH_201=$(cat $TMP2 | awk 'NR==1{print $1}' )
  ENGLISH_201=$(cat $TMP2 | awk 'NR==1{print $2}' )
  SCIENCE_201=$(cat $TMP2 | awk 'NR==1{printf $3}' )
  GRADE_201=$(cat $TMP2 | awk 'NR==1{print $4}' )
  </code></pre>
  
  <p>and so on...</p>
  
  <p>The variable contents should then be:</p>
  
  <ul>
  <li>MATH_101=25 </li>
  <li>MATH_102=12</li>
  <li>ENGLISH_101=16</li>
  <li>ENGLISH_102=17</li>
  <li>etc.</li>
  </ul>
  
  <p>Are there better ways than hard-coding these variables?</p>