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 ($line1 =~ m/$key/) {

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

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:\Proj

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.

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; } }

Replacing string

2002-09-27 Thread Zary Necheva
Hi, I have a file with this data: ..CITY/STATE. |aBalt., MD ..COUNTY. |aBALTIMORE ..CITY/STATE. |aBaltimore, Md ..COUNTY. |aBALTIMORE ..CITY/STATE. |aBaltimore, Maryland ..COUNTY. |aBALTIMORE ..CITY/STATE. |aBaltimore, MD ..COUNTY. |aBALTIMORE ..CITY/STATE. |aBALTIMORE, Md ..COUNTY.

Re: Replacing string

2002-09-27 Thread Dharmender Rai
your regexp for aBalt (aBalt*) is not correct. It is taking into account aBaltimore also. Instead , you should have written aBalt\.* --- Zary Necheva [EMAIL PROTECTED] wrote: Hi, I have a file with this data: ..CITY/STATE. |aBalt., MD ..COUNTY. |aBALTIMORE ..CITY/STATE. |aBaltimore,

Re: Replacing string

2002-09-27 Thread Sudarshan Raghavan
On Thu, 26 Sep 2002, Zary Necheva wrote: Hi, I have a file with this data: ..CITY/STATE. |aBalt., MD ..COUNTY. |aBALTIMORE ..CITY/STATE. |aBaltimore, Md ..COUNTY. |aBALTIMORE ..CITY/STATE. |aBaltimore, Maryland ..COUNTY. |aBALTIMORE ..CITY/STATE. |aBaltimore, MD ..COUNTY.

Re: Replacing string

2002-09-27 Thread Sudarshan Raghavan
On Fri, 27 Sep 2002, Dharmender Rai wrote: your regexp for aBalt (aBalt*) is not correct. It is taking into account aBaltimore also. Instead , you should have written aBalt\.* Your regex says the string 'aBalt' followed by 0 or more '.'. This should be 'aBalt.*' -- To unsubscribe,

Re: Replacing string

2002-09-27 Thread Janek Schleicher
Zary Necheva wrote at Thu, 26 Sep 2002 21:36:35 +0200: I have a file with this data: ..CITY/STATE. |aBalt., MD ..COUNTY. |aBALTIMORE ..CITY/STATE. |aBaltimore, Md ..COUNTY. |aBALTIMORE ..CITY/STATE. |aBaltimore, Maryland ..COUNTY. |aBALTIMORE ..CITY/STATE. |aBaltimore, MD