title: awk sub in specified column
body: <p>I'm trying to remove text before and after different delimiters, in a specific column only, column 3.</p>
  
  <p>First delimiter is semi-colon, second is comma. They exist in unshown columns too.</p>
  
  <p>Input data:</p>
  
  <pre><code>chr2L   54273   2L_54273_SNP;rs203207895        A       G       999     PASS    ALTCOUNT=118;DB;REFCOUNT=69     GT      ./.     ./.     0/0 
  chr2L   54339   2L_54339_SNP;rs206877787,rs80377533     T       A       999     PASS    ALTCOUNT=114;DB;REFCOUNT=73     GT      ./.     ./.  
  chr2L   54587   2L_54587_SNP;rs203534836        A       G       999     PASS    ALTCOUNT=5;DB;REFCOUNT=199      GT      0/0     0/0     0/0  
  </code></pre>
  
  <p>Required output:</p>
  
  <pre><code>chr2L   54273   rs203207895        A       G       999     PASS    ALTCOUNT=118;DB;REFCOUNT=69     GT      ./.     ./.     0/0 
  chr2L   54339   rs206877787     T       A       999     PASS    ALTCOUNT=114;DB;REFCOUNT=73     GT      ./.     ./.  
  chr2L   54587   rs203534836        A       G       999     PASS    ALTCOUNT=5;DB;REFCOUNT=199      GT      0/0     0/0     0/0  
  </code></pre>
  
  <p>My efforts have focussed on just removing text before (and including) the semi-colon but with no significant results:</p>
  
  <pre><code>awk '{ if ($3 == ".*\;//") {$3 = ""; print} else { print }; }' &lt; a &gt; b
  sed 's/.*;//' a &gt; b
  awk '{ sub(/*.;/,"",$3) }1 ' &lt; a &gt; b
  awk '{sub(;/./*,""); print}' &lt; a &gt; b
  </code></pre>