title: How to check last 3 chars of a string are alphabets or not using awk?
body: <p>I want to check if the last 3 letters in column 1 are alphabets and print those rows. What am I doing wrong?</p>
  <p>My code :-</p>
  <pre><code>awk -F '|' ' {print str=substr( $1 , length($1) - 2) } END{if ($str ~ /^[A-Za-z]/ ) print}' file
  </code></pre>
  <p>cat file</p>
  <pre><code>12300USD|0392
  abc56eur|97834
  238aed|23911
  aabccde|38731
  73716yen|19287
  .*/|982376
  0NRT0|928731
  
  </code></pre>
  <p>expected output :</p>
  <pre><code>12300USD|0392
  abc56eur|97834
  238aed|23911
  aabccxx|38731
  73716yen|19287
  </code></pre>