Re: Problem with replacing string in file

2006-11-29 Thread perl pra
thanks rob and Samstag.. have done it thanks a lot. On 11/25/06, Rob Dixon <[EMAIL PROTECTED]> wrote: Mumia W. wrote: > > On 11/25/2006 06:40 AM, perl pra wrote: >> >> Here is the code i have written... >> [snip] >> >> open $LOGFILE, '<', $file; >> while ($line1 = <$LOGFILE> ) { >>if ($

Re: Problem with replacing string in file

2006-11-25 Thread Rob Dixon
Mumia W. wrote: On 11/25/2006 06:40 AM, perl pra wrote: Here is the code i have written... [snip] open $LOGFILE, '<', $file; while ($line1 = <$LOGFILE> ) { if ($line1 =~ m/$key/) { system("perl -i.bak -p -e 's/$line1/$repline/g' $file"); close $LOGFILE; last; } }

Re: Problem with replacing string in file

2006-11-25 Thread Mumia W.
On 11/25/2006 06:40 AM, perl pra wrote: hi Gurus, I have a problem to replace strings of file thru perl script. Here is the problem in detail... I have a text file some thing like this.. PROJ_FOLER=C:\Proj PROJ_LOGS=C:\PROJ\LOGS I have same line in config file some thing like this. PR

Re: Problem with replacing string in file

2006-11-25 Thread D. Bolliger
perl pra am Samstag, 25. November 2006 13:40: > hi Gurus, > > I have a problem to replace strings of file thru perl script. [...] > I have a text file some thing like this.. > PROJ_FOLER=C:\Proj > PROJ_LOGS=C:\PROJ\LOGS > > I have same line in config file some thing like this. > PROJ_FOLDER=D:\Pro

Problem with replacing string in file

2006-11-25 Thread perl pra
hi Gurus, I have a problem to replace strings of file thru perl script. Here is the problem in detail... I have a text file some thing like this.. PROJ_FOLER=C:\Proj PROJ_LOGS=C:\PROJ\LOGS I have same line in config file some thing like this. PROJ_FOLDER=D:\Proj PROJ_LOGS=D:\PROJ\LOGS.