<p>Hi all,</p>

<p>I&#39;m dealing with a fasta file with spaces at the end of line, which caused the problem. I didn&#39;t find a suitable way to remove them. Please kindly tell me the appropriate command for removing them?</p>

    sed 's/ *$//g' in.fasta > out.fasta

will remove only spaces at the end of lines. To remove tab or space use:

    sed 's/\s*$//g' in.fasta > out.fasta