#!/usr/bin/awk -f # Extract the sequences in a fasta file. # One entire sequence per line out. /^>/ { # then we have a; definition line. # Print out the previous sequence if there was one. if ( seq ) { print seq; seq = ""; # and start anew. } next; # Ignore (strip) the definition line. } # Ignore (strip) comment lines. /^ *;/ { next; } # Collect sequence. { seq = seq $0; } END { if ( seq ) print seq; }