I know this is stupid, I posted similar question before, but I need a little modification to the code to get the right information.
This is the format of header.
>AAA23421(AI041) fim41, [Escherichia coli]
I need to extract only "AAA23421(AI041)" part from the header. The length of this part differs for sequences in this fasta file.
I tried to modify and use this code:
grep -Po -e ">.*?\)" fileName.fa | sed 's/^>//g' >file1.txt
but it didn't work.
Can anyone help with this?