title: Get Ascii Code?
body: <p>To retrieve the ascii code of all charterers of column 13th of a file I write this script</p>
  
  <pre><code>awk -v ch="'" '{
  for (i=1;i&lt;=length(substr($13,6,length($13)));i++)
  {cmd = printf \"%d\\n\" \"" ch substr(substr($13,6,length($13)),i,1) "\"" cmd | getline output close(cmd) ;
  Number= Number " " output 
  }
   print Number ; Number="" 
  }' ~/a.test
  </code></pre>
  
  <p>but it doesn't work in the right way! I mean it works fine a while then produces the weird results!?
  As an example , for this input (assume it's column 13th)</p>
  
  <blockquote>
    <p>CQ:Z:%8%%%%0%%%%9%%%%:%%%%%%%%%%%%%%%%%%</p>
  </blockquote>
  
  <p>I have to get this </p>
  
  <blockquote>
    <p>37 56 37 37 37 37 48 37 37 37 37 57 37 37 37 37 58 37 37 37 37 ...............</p>
  </blockquote>
  
  <p>But I have this</p>
  
  <blockquote>
    <p>37 56 37 37 37 37 48 48 48 48 48 57 57 57 57 57 58 58 58 58 58 ...............</p>
  </blockquote>
  
  <p>As you can see first miss-computation appear after character "0" (48 in result).</p>
  
  <p>Do you know which part of my code is responsible for this error ?!</p>