Search and write to .txt file

2009-08-11 Thread Helvin
Hi everyone, I am writing some python script that should find a line which contains '1' in the data.txt file, then be able to move a certain number of lines down, before replacing a line. At the moment, I am able to find the line '1', but when I use f.seek to move, and then rewrite, what I write

Re: Search and write to .txt file

2009-08-11 Thread Kushal Kumaran
On Tue, Aug 11, 2009 at 4:52 PM, Helvinhelvin...@gmail.com wrote: Hi everyone, I am writing some python script that should find a line which contains '1' in the data.txt file, then be able to move a certain number of lines down, before replacing a line. At the moment, I am able to find the

Re: Search and write to .txt file

2009-08-11 Thread Piet van Oostrum
Helvin helvin...@gmail.com (H) wrote: H Hi everyone, H I am writing some python script that should find a line which contains H '1' in the data.txt file, then be able to move a certain number of H lines down, before replacing a line. At the moment, I am able to find H the line '1', but when I

Re: Search and write to .txt file

2009-08-11 Thread Mark Lawrence
Helvin wrote: Hi everyone, I am writing some python script that should find a line which contains '1' in the data.txt file, then be able to move a certain number of lines down, before replacing a line. At the moment, I am able to find the line '1', but when I use f.seek to move, and then

Re: Search and write to .txt file

2009-08-11 Thread Dave Angel
Piet van Oostrum wrote: Helvin helvin...@gmail.com (H) wrote: H Hi everyone, H I am writing some python script that should find a line which contains H '1' in the data.txt file, then be able to move a certain number of H lines down, before replacing a line. At the moment, I am

Re: Search and write to .txt file

2009-08-11 Thread Simon Forman
On Aug 11, 7:22 am, Helvin helvin...@gmail.com wrote: Hi everyone, I am writing some python script that should find a line which contains '1' in the data.txt file, then be able to move a certain number of lines down, before replacing a line. At the moment, I am able to find the line '1', but