title: Awk: printing undetermined number of columns
body: <p>I have a file that contains a number of fields separated by tab. I am trying to print all columns except the first one but want to print them all in only <em>one</em> column with AWK. The format of the file is </p>
  
  <pre><code>col 1   col 2   ... col n
  </code></pre>
  
  <p>There are at least 2 columns in one row. </p>
  
  <p><strong>Sample</strong></p>
  
  <pre><code>2012029754      901749095
  2012028240      901744459       258789
  2012024782      901735922
  2012026032      901738573       257784
  2012027260      901742004
  2003062290      901738925       257813  257822
  2012026806      901741040
  2012024252      901733947       257493
  2012024365      901733700
  2012030848      901751693       260720  260956  264843  264844
  </code></pre>
  
  <p>So I want to tell awk to print column 2 to column n for n greater than 2 without printing blank lines when there is no info in column n of that row, all in one column like the following.</p>
  
  <pre><code>901749095
  901744459
  258789
  901735922
  901738573
  257784
  901742004
  901738925
  257813
  257822
  901741040
  901733947
  257493
  901733700
  901751693
  260720
  260956
  264843
  264844
  </code></pre>
  
  <p>This is the first time I am using awk, so bear with me. I wrote this from command line which works:</p>
  
  <pre><code>awk '{i=2; 
  while ($i ~ /[0-9]+/)
  { 
      printf "%s\n", $i
      i++
  }
  }' bth.data
  </code></pre>
  
  <p>It is more of a seeking approval than asking a question whether it is the right way of doing something like this in AWK or is there a better/shorter way of doing it.</p>
  
  <p>Note that the actual input file could be millions of lines.</p>
  
  <p>Thanks</p>