title: awk select part of column (3rd of 3 characters)
body: <p>I have a number of files where I select some columns with the following </p>
  
  <pre><code>cat test.txt | awk ' {
  if ($11 ~ /229/ &amp;&amp; $5 ~ /1A1/) 
  {print $0, ($3 + 1) }         
  if ($11 ~ /229/ &amp;&amp; $5 ~ /1A2/) 
  {print $0, ($3 - 1) }
  if ($11 ~ /49/ &amp;&amp; $5 ~ /1A1/)  
  {print $0, ($3 - 1)}
  if ($11 ~ /49/ &amp;&amp; $5 ~ /1A2/)
  {print $0, ($3 + 1) }
  }' &gt; output
  </code></pre>
  
  <p>The problem is that some files might have different letter for <code>1A1</code> or <code>1A2</code> such as <code>1K1</code>, <code>1K2</code>..... 
  I would like to make the condition  <code>$5 ~(/1A2/) or  $5 ~(/1A1/)</code> more "general" and I tried things like </p>
  
  <pre><code>$5 ~(/??1/)
  $5 ~(/??2/)
  </code></pre>
  
  <p>So far no success. Can anyone help me on that?
  Please note that I need to keep also the selection criteria in $11</p>
  
  <pre><code>cat test.txt | awk ' {
      if ($11 ~ /229/ &amp;&amp; $5 ~ /??1/)
  ....
  </code></pre>