title: Replace headers of a multi fasta file awk
body: <p>I am trying to change the headers from a multi fasta file using awk.</p>
  
  <p>My file looks as follows:</p>
  
  <pre><code>&gt;NS500106:288:HGHTHAFXY:1:11101:16650:2011:CTATAC;size=206083;
  GTACAACCTCCAGGAAATCGTGCCCGGCAGCGTGTGGATGGAGAGGGACGTG
  &gt;NS500106:288:HGHTHAFXY:1:11101:1149:1903:CTATAC;size=19175;
  CAGCGAGAGCGAGACGCAGCCGGTGAACCGCGTGGCGTACAACGTCGGCGGGCAGATGGCCACCAACAACCAGAGCTCCA
  CCACTGCCCCCGCGACCGGCACGTACAACCTCCAGGAAATCGTGCCCGGCAGCGTGTGGATGGAGAGGGACGTG
  </code></pre>
  
  <p>I am using this command:</p>
  
  <pre><code>awk '/[^;]*/{print "Variant_" ++i; next} {print}' &lt; input.fasta &gt; output.fasta
  </code></pre>
  
  <p>Where, <code>/[^;]*/</code> matches lines upto the first occurence of the semi colon and replaces matched part of the header with Variant_1, Variant_2 and so on.</p>
  
  <p>The above command changes the entire header to Variant_1 and so on and also does not print the sequence lines.</p>
  
  <p>How can I resolve this?</p>
  
  <p>My desired output is as below:</p>
  
  <pre><code>Variant_1;size=206083;
  GTACAACCTCCAGGAAATCGTGCCCGGCAGCGTGTGGATGGAGAGGGACGTG
  Variant_2;size=19175;
  CAGCGAGAGCGAGACGCAGCCGGTGAACCGCGTGGCGTACAACGTCGGCGGGCAGATGGCCACCAACAACCAGAGCTCCA
  CCACTGCCCCCGCGACCGGCACGTACAACCTCCAGGAAATCGTGCCCGGCAGCGTGTGGATGGAGAGGGACGTG
  </code></pre>