파일에서 콘텐츠 제거

파일에서 콘텐츠 제거

이런 파일이 있어요

>gene1*ENSG24
CTTGGGGGGCTGGGGGCCAGGTGAAAGGGAAATGGAGGGCAGCACCCGCG
AGCCCTCATTGCCTATAGTGGTTTCCATGGCGATCATGTAAGAGTCAATG
TCGTCATTGGCAAAGTCGTCCGGGTGGGGTGTGCTGTAGGCAGAATCGGA
GTATCAGGGAGGGGACTGGGGGAGCAGAGGCAGGGCCCCACCTTGGAGGG
CTCGAAGGGAGCTCTGGGGCCCCCGACCACTGGAGA
>gene2*ENSG87
CCATTTTGAAACCCTTAATAAAAACTTGCTGGTCTGAGACTCAGCAGGCA
GCACAGACTTACTGATATGTACTGTCACCTCCAGCGGCCCAGCTGTAAAA
TTCCTCTCTTTGTAGTGTCTCTCTTTATTTCTCAGCTGGCTGACACTTAT
GGAAAATGGAAAGAACCTATGTTGAAATATTGGGGGCAGGTTCCATCAAT
AGTTCTTACATGG

다음 형식으로 출력하고 싶습니다.

>gene1
CTTGGGGGGCTGGGGGCCAGGTGAAAGGGAAATGGAGGGCAGCACCCGCG
AGCCCTCATTGCCTATAGTGGTTTCCATGGCGATCATGTAAGAGTCAATG
TCGTCATTGGCAAAGTCGTCCGGGTGGGGTGTGCTGTAGGCAGAATCGGA
GTATCAGGGAGGGGACTGGGGGAGCAGAGGCAGGGCCCCACCTTGGAGGG
CTCGAAGGGAGCTCTGGGGCCCCCGACCACTGGAGA
>gene2
CCATTTTGAAACCCTTAATAAAAACTTGCTGGTCTGAGACTCAGCAGGCA
GCACAGACTTACTGATATGTACTGTCACCTCCAGCGGCCCAGCTGTAAAA
TTCCTCTCTTTGTAGTGTCTCTCTTTATTTCTCAGCTGGCTGACACTTAT
GGAAAATGGAAAGAACCTATGTTGAAATATTGGGGGCAGGTTCCATCAAT
AGTTCTTACATGG

*ENSG 부분을 제거하고 싶습니다. 어떻게 해야 하나요?

답변1

충분히 간단해야 합니다 sed.

sed 's/.ENSG[0-9]*$//'

관련 정보