title: Calculating 95th percentile with awk
body: <p>I'm new in awk scripting and would like to have some help in calculating 95th percentile value for a file that consist of this data:</p>
  
  <pre><code>0.0001357
  0.000112
  0.000062
  0.000054
  0.000127
  0.000114
  0.000136
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>cat filename.txt | sort -n |
  awk 'BEGIN{c=0} {total[c]=$1; c++;} END{print total[int(NR*0.95-0.5)]}'
  </code></pre>
  
  <p>but I dont seem to get the correct value when I compare it to excel.</p>