title: Extracting multiple columns without loop
body: <p>I am writing an awk script that will take the output of grep and nicely format that into an HTML table.  The delimiter is the ":" character; the problem I'm running into is that that character can appear in the text as well.  So if I just use $1, $2, and $3 for the filename, line number, and comment respectively, I lose anything after the first : in the comment</p>
  
  <p>Is there a way to say $1, $2, and then $3..NR without explicitly looping over the columns and concatenating them together?</p>
  
  <p>Here's the script so far:</p>
  
  <p>`</p>
  
  <pre><code>#!/usr/bin/awk
  
  BEGIN {
      FS=":"
  
      print "&lt;html&gt;&lt;body&gt;"
      print "&lt;table&gt;"
      print "&lt;tr&gt;&lt;td&gt;File name&lt;/td&gt;&lt;td&gt;Line number&lt;/td&gt;&lt;td&gt;Comment&lt;/td&gt;&lt;/tr&gt;"
  }
  
  {
      print "&lt;tr&gt;&lt;td&gt;" $1 "&lt;/td&gt;&lt;td&gt;" $2 "&lt;/td&gt;&lt;td&gt;" $3 "&lt;/td&gt;&lt;/tr&gt;"
  }
  END {
      print "&lt;/table&gt;"
      print "&lt;/body&gt;&lt;/html&gt;"
  
  }`
  </code></pre>
  
  <p>And some sample input:</p>
  
  <pre><code>./mysql-connector-java-5.0.8/src/com/mysql/jdbc/BlobFromLocator.java:177:       // TODO: Make fetch size configurable
  ./mysql-connector-java-5.0.8/src/com/mysql/jdbc/CallableStatement.java:243:     // TODO Auto-generated method stub
  ./mysql-connector-java-5.0.8/src/com/mysql/jdbc/CallableStatement.java:836:     // TODO: Do this with less memory allocation
  </code></pre>