title: setting default numeric format in awk
body: <p>I wanted to do a simple parsing of two files with ids and some corresponding numerical values. I didn't want awk to print numbers in scientific notation.</p>
  
  <p>File looks like this:</p>
  
  <pre><code>someid-1 860025 50.0401 4.00022
  someid-2 384319 22.3614 1.78758
  someid-3 52096 3.03118 0.242314
  someid-4 43770 2.54674 0.203587
  someid-5 33747 1.96355 0.156967
  someid-6 20281 1.18004 0.0943328
  someid-7 12231 0.711655 0.0568899
  someid-8 10936 0.636306 0.0508665
  someid-9 10224.8 0.594925 0.0475585
  someid-10 10188.8 0.59283 0.047391
  </code></pre>
  
  <p>when use print instead of printf :</p>
  
  <pre><code>awk 'BEGIN{FS=OFS="\t"} NR==FNR{x[$1]=$0;next} ($1 in x){split(x[$1],k,FS); print $1,k[2],k[3],k[4],$2,$3,$4}' OSCAo.txt dme_miRNA_PIWI_OSC.txt | sort -n -r -k 7 | head
  </code></pre>
  
  <p>i get this result:</p>
  
  <pre><code>dme-miR-iab-4-5p      0.333333    0.000016    0.000001  0.25    0.000605606 9.36543e-07
  dme-miR-9c-5p   10987.300000      0.525413    0.048798  160.2   0.388072    0.000600137
  dme-miR-9c-3p   731.986000    0.035003    0.003251  2.10714 0.00510439  7.89372e-06
  dme-miR-9b-5p   30322.500000      1.450020    0.134670  595.067 1.4415  0.00222922
  dme-miR-9b-3p   2628.280000   0.125684    0.011673  48  0.116276    0.000179816
  dme-miR-9a-3p    10.365000    0.000496    0.000046  0.25    0.000605606 9.36543e-07
  dme-miR-999-5p  103.433000    0.004946    0.000459  0.0769231   0.00018634  2.88167e-07
  dme-miR-999-3p  1513.790000   0.072389    0.006723  28  0.0678278   0.000104893
  dme-miR-998-5p  514.000000    0.024579    0.002283  73  0.176837    0.000273471
  dme-miR-998-3p  3529.000000   0.168756    0.015673  42  0.101742    0.000157339
  </code></pre>
  
  <p><em>Notice the scientific notation in the last column</em></p>
  
  <p>I understand that printf with appropriate format modifier can do the job but the code becomes very lengthy. I have to write something like this:</p>
  
  <pre><code>awk 'BEGIN{FS=OFS="\t"} NR==FNR{x[$1]=$0;next} ($1 in x){split(x[$1],k,FS); printf "%s\t%3.6f\t%3.6f\t%3.6f\t%3.6f\t%3.6f\t%3.6f\n", $1,k[2],k[3],k[4],$2,$3,$4}' file1.txt file2.txt &gt; fileout.txt
  </code></pre>
  
  <p>This becomes clumsy when I have to parse <code>fileout</code> with another similarly structured file.</p>
  
  <p>Is there any way to specify default <strong>numerical</strong> output, such that any string will be printed like a string but all numbers follow a particular format.</p>