I have fasta file namely `119XCA.fasta` as shown below,

    >cellulase
    ATGCTA
    >gyrase
    TGATGCT
    >16s
    TAGTATG
I need to remove all the fasta headers, keep the sequences one by one and need to write file name as a fasta header. The expected outcome is shown below,

    >119XCA
    ATGCTA
    TGATGCT
    TAGTATG
I have used the following script `sed '/^>/d' foo.fa > out.fa` which remove the fasta headers but, i do not know how to manage to write file name as a header. Therefore, please help me to do the same.


   

try this:

    $ cat test.fa
    >cellulase
    ATGCTA
    >gyrase
    TGATGCT
    >16s
    TAGTATG
    
    $  awk 'BEGIN {print ">"ARGV[1]};!/^>/{print}' test.fa

    >test.fa
    ATGCTA
    TGATGCT
    TAGTATG

    $ cat <(echo ">"$basename test.fa) <(grep -v ">" test.fa) (note:extra space in header)
    > test.fa
    ATGCTA
    TGATGCT
    TAGTATG