This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to delete spaces from fasta file IDs

Hi All!

I need to delete the blank spaces between words in the headers from my fasta file.

Example

Input:

> Proteobacteria;_1 # 52 # 312 # 1 # ID=1_1;partial=01;start

Output:

>Proteobacteria;_1#52#312#1# ID=1_1;partial=01;start

Thanks a lot!

fasta

1 answer

sed -i 's/\ //g' file.fasta

Your example output leaves a space in still. I've assumed that's a typo based on your request.

Log in to answer this question.