title: getting fatal: attempt to use a scalar value as array error while creating join between two files
body: <p>I am creating a full outer join between two files and to do so, I am using awk to store both the files records in separate array and then print them later by using two for loops.</p>
  
  <pre><code>awk 'FNR==NR{a[NR]=$0;next}{x=1;b[x]=$0;x=x+1} END{for(i in b[i]){for (j in a[j]) print b[i] "\t" a[j] "" }}' transpose.txt rows.txt
  </code></pre>
  
  <p>The error I get by is this part</p>
  
  <pre><code>END{for(i in b[i]){for (j in a[j]) print b[i] "\t" a[j] "" }}
  </code></pre>
  
  <p>I tried running the code without this part, print just a[1] and b[1]. It is able to do so. But when I put two for loops there to print the full outer join of two. I get this array os using scalar value as array! What am I doing wrong here?
  The full error I get is </p>
  
  <pre><code>awk: cmd. line:1: (FILENAME=rows.txt FNR=176) fatal: attempt to use a scalar value as array
  </code></pre>