I am a beginner to do any coding, but still i'll try to do something..
My problem:
i need copy some lines Start.txt to end.txt, only what i know is line numbers, marks/numbers inside the line doest not same all the time, line numbers are. So i cant use .replace method?
Example
Start.txt
Something like this what i find:
Thanks!
My problem:
i need copy some lines Start.txt to end.txt, only what i know is line numbers, marks/numbers inside the line doest not same all the time, line numbers are. So i cant use .replace method?
Example
Start.txt
1111111111 2222222222 3333333333 4444444444 <------ This line 5555555555 <------ And this lineEnd.txt
888888888 999999999 AAAAAAAAA BBBBBBBBB <----- to here <----- to herei was find some enumerate example before, and try to adjust it, but too hard from beginner.
Something like this what i find:
with open('start.txt') as fin, open('end.txt', 'w') as fout: for i, item in enumerate(fin, 1): if i == 7: item = "string\n" fout.write(item)This code add only "string" word to line which number i gave...
Thanks!