title: Print a comma except on the last line in Awk
body: <p>I have the following script</p>
  
  <pre><code>awk '{printf "%s", $1"-"$2", "}' $a &gt;&gt; positions;
  </code></pre>
  
  <p>where <code>$a</code> stores the name of the file. I am actually writing multiple column values into one row. However, I would like to print a comma only if I am not on the last line.</p>