Re: Replacing line in a text file

2006-09-25 Thread Larry Bates
CSUIDL PROGRAMMEr wrote: > Folks > I am trying to read a file > This file has a line containing string 'disable = yes' > > I want to change this line to 'disable = no' > > The concern here is that , i plan to take into account the white spaces > also. > > I tried copying all file int list and t

Re: Replacing line in a text file

2006-09-22 Thread Eric
CSUIDL PROGRAMMEr wrote: > Folks > I am trying to read a file > This file has a line containing string 'disable = yes' > > I want to change this line to 'disable = no' > > The concern here is that , i plan to take into account the white spaces > also. > > I tried copying all file int list and the

Re: Replacing line in a text file

2006-09-22 Thread Eric
Tim Chase wrote: > > That is, until such time as Guido finalizes PyESP. > > > > import PyESP > > e = ESP.mindread(CSUIDL, "r") > > Sounds like an extension to the __future__ module. > > >>> from __future__ import answers > >>> answers.answer(op.question) > > How many other languages have a time-

Re: Replacing line in a text file

2006-09-22 Thread Frederic Rentsch
CSUIDL PROGRAMMEr wrote: > Folks > I am trying to read a file > This file has a line containing string 'disable = yes' > > I want to change this line to 'disable = no' > > The concern here is that , i plan to take into account the white spaces > also. > > I tried copying all file int list and then

Re: Replacing line in a text file

2006-09-22 Thread Tim Chase
> That is, until such time as Guido finalizes PyESP. > > import PyESP > e = ESP.mindread(CSUIDL, "r") Sounds like an extension to the __future__ module. >>> from __future__ import answers >>> answers.answer(op.question) How many other languages have a time-machine built-in, that will take th

Re: Replacing line in a text file

2006-09-22 Thread Tim Chase
> I am trying to read a file > This file has a line containing string 'disable = yes' > > I want to change this line to 'disable = no' Sounds like sed -i 's/disable *= *yes/disable = no/' file.txt would do what you want. It doesn't catch word boundaries, so if you have something like

Re: Replacing line in a text file

2006-09-22 Thread Neil Cerutti
On 2006-09-22, CSUIDL PROGRAMMEr <[EMAIL PROTECTED]> wrote: > Folks > I am trying to read a file > This file has a line containing string 'disable = yes' > > I want to change this line to 'disable = no' > > The concern here is that , i plan to take into account the white spaces > also. > > I tried

Replacing line in a text file

2006-09-22 Thread CSUIDL PROGRAMMEr
Folks I am trying to read a file This file has a line containing string 'disable = yes' I want to change this line to 'disable = no' The concern here is that , i plan to take into account the white spaces also. I tried copying all file int list and then tried to manipulate that list But the se