hey, thanks to all of them who helps me in learning this language,
again there is one text file
file 1.txt
>sp|P81928[/B]|140U_DROME
67 198 Tim17 8.9e-19 No_clan
>sp|P20905|5HT1R_DROME
179 507 7tm_1 1.1e-97 CL0192
>sp|P28285|5HT2A_DROME
243 805 7tm_1 3.2e-73 CL0192
>sp|P28286|5HT2B_DROME
107 588 7tm_1 7.2e-82 CL0192
* here the number represents the start and ending of subsequence which has to be extracted.
the next file is sequence file2.txt
>sp|P81928|140U_DROME RPII140-upstream gene protein OS=Drosophila melanogaster GN=140up PE=2 SV=2
MNFLWKGRRFLIAGILPTFEGAADEIVDKENKTYKAFLASKPPEETGLERLKQMFTIDEF
GSISSELNSVYQAGFLGFLIGAIYGGVTQSRVAYMNFMENNQATAFKSHFDAKKKLQDQF
TVNFAKGGFKWGWRVGLFTTSYFGIITCMSVYRGKSSIYEYLAAGSITGSLYKVSLGLRG
MAAGGIIGGFLGGVAGVTSLLLMKASGTSMEEVRYWQYKWRLDRDENIQQAFKKLTEDEN
PELFKAHDEKTSEHVSLDTIK
>sp|P20905|5HT1R_DROME 5-hydroxytryptamine receptor 1 OS=Drosophila melanogaster GN=5-HT7 PE=2 SV=1
MALSGQDWRRHQSHRQHRNHRTQGNHQKLISTATLTLFVLFLSSWIAYAAGKATVPAPLV
EGETESATSQDFNSSSAFLGAIASASSTGSGSGSGSGSGSGSGSGSYGLASMNSSPIAIV
SYQGITSSNLGDSNTTLVPLSDTPLLLEEFAAGEFVLPPLTSIFVSIVLLIVILGTVVGN
VLVCIAVCMVRKLRRPCNYLLVSLALSDLCVALLVMPMALLYEVLEKWNFGPLLCDIWVS
FDVLCCTASILNLCAISVDRYLAITKPLEYGVKRTPRRMMLCVGIVWLAAACISLPPLLI
LGNEHEDEEGQPICTVCQNFAYQIYATLGSFYIPLSVMLFVYYQIFRAARRIVLEEKRAQ
THLQQALNGTGSPSAPQAPPLGHTELASSGNGQRHSSVGNTSLTYSTCGGLSSGGGALAG
HGSGGGVSGSTGLLGSPHHKKLRFQLAKEKKASTTLGIIMSAFTVCWLPFFILALIRPFE
TMHVPASLSSLFLWLGYANSLLNPIIYATLNRDFRKPFQEILYFRCSSLNTMMRENYYQD
QYGEPPSQRVMLGDERHGARESFL
>sp|P28285|5HT2A_DROME 5-hydroxytryptamine receptor 2A OS=Drosophila melanogaster GN=5-HT1A PE=2 SV=2
MAHETSFNDALDYIYIANSMNDRAFLIAEPHPEQPNVDGQDQDDAELEELDDMAVTDDGQ
LEDTNNNNNSKRYYSSGKRRADFIGSLALKPPPTDVNTTTTTAGSPLATAALAAAAASAS
VAAAAARITAKAAHRALTTKQDATSSPASSPALQLIDMDNNYTNVAVGLGAMLLNDTLLL
EGNDSSLFGEMLANRSGQLDLINGTGGLNVTTSKVAEDDFTQLLRMAVTSVLLGLMILVT
IIGNVFVIAAIILERNLQNVANYLVASLAVADLFVACLVMPLGAVYEISQGWILGPELCD
IWTSCDVLCCTASILHLVAIAVDRYWAVTNIDYIHSRTSNRVFMMIFCVWTAAVIVSLAP
QFGWKDPDYLQRIEQQKCMVSQDVSYQVFATCCTFYVPLLVILALYWKIYQTARKRIHRR
RPRPVDAAVNNNQPDGGAATDTKLHRLRLRLGRFSTAKSKTGSAVGVSGPASGGRALGLV
DGNSTNTVNTVEDTEFSSSNVDSKSRAGVEAPSTSGNQIATVSHLVALAKQQGKSTAKSS
AAVNGMAPSGRQEDDGQRPEHGEQEDREELEDQDEQVGPQPTTATSATTAAGTNESEDQC
KANGVEVLEDPQLQQQLEQVQQLQKSVKSGGGGGASTSNATTITSISALSPQTPTSQGVG
IAAAAAGPMTAKTSTLTSCNQSHPLCGTANESPSTPEPRSRQPTTPQQQPHQQAHQQQQQ
QQQLSSIANPMQKVNKRKETLEAKRERKAAKTLAIITGAFVVCWLPFFVMALTMPLCAAC
QISDSVASLFLWLGYFNSTLNPVIYTIFSPEFRQAFKRILFGGHRPVHYRSGKL
i want to extract the subsequence from this sequences with respect to the proteins id