I have this text file:
>P1;3RVYA
sequence:: : : : :::-1.00:-1.00
MYLRITNIVESSFFTKFIIYLIVLNGITMGLETSKTFMQSFGVYTTLFNQIVITIFTIEIILR-IYVHRISFFKD
PWSLFDFFVVAISLVPTSS---GFEILRVLRVLRLFRLVTAVPQMRKIVSALISVIPGMLSVIALMTLFFYIFAI
MATQLFGERFP---------------------------------------------EWFGTLGESFYTLFQVMTL
ESWSMGIVRP-LMEVYPYAWVFFIPFIFVVTFVMINLVVAICVDAM*
>P1;Dominio1
sequence:: : : : :::-1.00:-1.00
EWPPFEYMILATIIANCIVLALEQH---LPDDDKTPMSERLDDTEPYFIGIFCFEAGIKIIALGFAFHKGSYLRN
GWNVMDFVVVLTGILATVGTEFDLRTLRAVRVLRPLKLVSGIPSLQVVLKSIMKAMIPLLQIGLLLFFAILIFAI
IGLEFYMGKFHTTCFEEGTDDIQGESPAPCGTEEPARTCPNGTKCQPYWEGPNNGITQFDNILFAVLTVFQCITM
EGWTDLLYNSNDASGNTWNWLYFIPLIIIGSFFMLNLVLGVLSGEF*
I need to replace the word "sequence", it is under of the word 3RVYA (only that)
I have this command:
a="3RVYA"
for line in file('%s'%I):
if a in line:
print line
But just printed "3RV", I need only print the next line, that have the word "sequence", I need it to replace "sequence" for "structure".
I'm beginner in python, so...Can somebody help me please? Thanks so much
print all_the_text.replace('3RVYA\n\nsequence', '3RVYA\n\nstructure')