Thursday, August 18, 2011

Simple Bash command line to reduce the length of the fasta header lines.

Hi there, how many times we download a FASTA file that contains a huge and enormous fasta header like this:

So, to clean up the header, just use this simple command line:

$ cat <input_file> | awk '{print $1}' > <output_file>


$ cat data.fa | awk '{print $1}' > data_parsed.fa

And the output will be:

Hope this helps