title: awk array initialization at each line fails
body: <p>I have a log file where each line contains some numbers separated by <code>,</code>. I just wanted to some operation with each number. It seemed easy with awk, but somehow i got stuck. The array which i'm using to split each line, is getting initialized only once at the first line. After that the array is not getting clear. split is supposed to clear the array first then use it, i have even used <code>delete array</code>. But still the problem persists. Any help will be appreciated.<br>
  Below is some example;
  This is a sample file</p>
  
  <pre><code>[[bash_prompt$]]$ cat log
  1,2,3
  2
  9
  1,4
  5,7
  7
  8
  6,2
  </code></pre>
  
  <p>This is what i'm getting</p>
  
  <pre><code>[[bash_prompt$]]$ awk '{print "New Line " $1; delete a; split($1,a,","); for(var in a){ print "Array Element " var; } }' log
  New Line 1,2,3
  Array Element 1
  Array Element 2
  Array Element 3
  New Line 2
  Array Element 1
  New Line 9
  Array Element 1
  New Line 1,4
  Array Element 1
  Array Element 2
  New Line 5,7
  Array Element 1
  Array Element 2
  New Line 7
  Array Element 1
  New Line 8
  Array Element 1
  New Line 6,2
  Array Element 1
  Array Element 2
  </code></pre>
  
  <p>But below is what I am expecting</p>
  
  <pre><code>[[bash_prompt$]]$ awk '{print "New Line " $1; delete a; split($1,a,","); for(var in a){ print "Array Element " var; } }' log
  New Line 1,2,3
  Array Element 1
  Array Element 2
  Array Element 3
  New Line 2
  Array Element 2
  New Line 9
  Array Element 9
  New Line 1,4
  Array Element 1
  Array Element 4
  New Line 5,7
  Array Element 5
  Array Element 7
  New Line 7
  Array Element 7
  New Line 8
  Array Element 8
  New Line 6,2
  Array Element 6
  Array Element 2
  </code></pre>
  
  <p>Mine is GNU Awk 3.1.5. Also I have found another way by using combination of shell and awk, ( running awk individually on each line) but i want to know what I am  doing wrong</p>