Entering edit mode
3.1 years ago
Jelo
•
0
Hi all,
I have a fasta file with this header
>10005_M12.fastq Otu0001|242290|M1.fastq-M12.fastq-M5.fastq-URTM6.fastq-M7.fastq-M9.fastq
I want to remove all the header parts except the OTU (with its number), I used the this command sed 's/>M.*Otu/>Otu/g' rep.fasta |sed -e 's/|.*//g'> rep.otu.fasta
but the command removed only the part after OTU as following;
>10005_M12.fastq Otu0001
I want the header looks like (>Otu0001
)
Any advice will be appreciated
Thank you
Thank you all for help
If an answer was helpful, you should upvote it; if the answer resolved your question, you should mark it as accepted. You can accept more than one if they work.