>first TTCCCAAAAAAGACCTACTAAGTCAAGCGGATGCGTTTTGTGTCTTATGG AAAGTCCCTGACGGATACGAGGCTTTGGGTGATTCGGTACGAATGATTCG GTTACCAGAACTTACCGAAGAAGAAATGGGACGAACCGAGGTTTCTCGTT CGTGTGCTAATCCTACATTCAAACATCGATTTCGATCAGAGTTTGTTTTT CATGAAGAACAGACATTCGTATTACGTGTTTACGATGAAGATTTGAGGTA >firsta TTCCCAAAAAAGACCTACTAAGTCAAGCGGATGCGTTTTGTGTCTTATGG AAAGTCCCTGACGGATACGAGGCTTTGG---------------------- -----------------AAGAAGAAATGGGACGAACCGAGGTTTCTCGTT CGTGTGCTAATCCTACATTCAAACATCGATTTCGATCAGAGTTT------ CATGAAGAACAGACATTCGTATTACGTGTTTACGATGAAGATTTGAGGTA
Both >first and >firsta containing same characters except the part with hyphens. Now is it possible to write a perl script that would extract the text starting after >firsta and before the start of - for each line? Also, would it be possible to extract the unmatched text from >first?
Please note that both >first and >firsta are in the same text file and other similar text files which I am using might contain more lines like these. Thanks a lot in advance..
In reply to An interesting Perl problem to extract file content by ghosh24
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |