title: Sequence length of FASTA file
body: <p>I have the following FASTA file:</p>
  
  <pre><code>&gt;header1
  CGCTCTCTCCATCTCTCTACCCTCTCCCTCTCTCTCGGATAGCTAGCTCTTCTTCCTCCT
  TCCTCCGTTTGGATCAGACGAGAGGGTATGTAGTGGTGCACCACGAGTTGGTGAAGC
  &gt;header2
  GGT
  &gt;header3
  TTATGAT
  </code></pre>
  
  <p>My desired output:</p>
  
  <pre><code>&gt;header1
  117
  &gt;header2
  3
  &gt;header3
  7
  # 3 sequences, total length 127.
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>awk '/^&gt;/ {print; next; } { seqlen = length($0); print seqlen}' file.fa
  </code></pre>
  
  <p>The output I get with this code is:</p>
  
  <pre><code>&gt;header1
  60
  57
  &gt;header2
  3
  &gt;header3
  7
  </code></pre>
  
  <p>I need a small modification in order to deal with multiple sequence lines.</p>
  
  <p>I also need a way to have the total sequences and total length. Any suggestion will be welcome... In bash or awk, please. I know that is easy to do it in Perl/BioPerl and actually, I have a script to do it in those ways.</p>