re: searching and replacing

2005-03-11 Thread FlashMX
Hi, I need to modify some existing code. The below line checks a file I'm reading in and does a search/replace based on the match. Currently I'm looking for... if (/0 set/) { ...etc. Because the 00 can change to different numbers (but always 6 figures which could include a period)

Re: searching and replacing

2005-03-11 Thread Wiggins d'Anconia
FlashMX wrote: Hi, I need to modify some existing code. The below line checks a file I'm reading in and does a search/replace based on the match. Currently I'm looking for... if (/0 set/) { ...etc. Because the 00 can change to different numbers (but always 6 figures which could include a

Re: searching and replacing

2005-03-11 Thread FlashMX
Cool...that worked...thanks I forgot to mention that one the match is found I do a search and replace if (/[0-9.]{6} setgray/) { s/.9 set/-50.2 v \n.9 set/; This is the issue. I need to grab the match number (whatever it is) and add it into the s/

Re: searching and replacing

2005-03-11 Thread Wiggins d'Anconia
Because it's up-side down. Why is that? It makes replies harder to read. Why not? Please don't top-post. (Sherm Pendley, MacOSX List) FlashMX wrote: Cool...that worked...thanks I forgot to mention that one the match is found I do a search and replace if (/[0-9.]{6} setgray/) {

Re: searching and replacing

2005-03-11 Thread John W. Krahn
FlashMX wrote: Hi, Hello, I need to modify some existing code. The below line checks a file I'm reading in and does a search/replace based on the match. Currently I'm looking for... if (/0 set/) { ...etc. Because the 00 can change to different numbers (but always 6 figures which could

Re: searching and replacing

2005-03-11 Thread John W. Krahn
John W. Krahn wrote: FlashMX wrote: I need to modify some existing code. The below line checks a file I'm reading in and does a search/replace based on the match. Currently I'm looking for... if (/0 set/) { ...etc. Because the 00 can change to different numbers (but always 6 figures which

Re: searching and replacing

2005-03-11 Thread FlashMX
FlashMX wrote: Cool...that worked...thanks I forgot to mention that one the match is found I do a search and replace if (/[0-9.]{6} setgray/) { s/.9 set/-50.2 v \n.9 set/; This is the issue. I need to grab the match number (whatever it is) and

Re: searching and replacing

2005-03-11 Thread FlashMX
On Fri, 11 Mar 2005 07:53:30 -0800, John W. Krahn wrote: John W. Krahn wrote: FlashMX wrote: I need to modify some existing code. The below line checks a file I'm reading in and does a search/replace based on the match. Currently I'm looking for... if (/0 set/) { ...etc. Because the

Re: searching and replacing

2005-03-11 Thread John W. Krahn
FlashMX wrote: Cool...that worked...thanks I forgot to mention that one the match is found I do a search and replace if (/[0-9.]{6} setgray/) { s/.9 set/-50.2 v \n.9 set/; This is the issue. I need to grab the match number (whatever it is) and add it into

Re: searching and replacing

2005-03-11 Thread FlashMX
On Fri, 11 Mar 2005 10:57:19 -0500, FlashMX wrote: On Fri, 11 Mar 2005 07:53:30 -0800, John W. Krahn wrote: John W. Krahn wrote: FlashMX wrote: I need to modify some existing code. The below line checks a file I'm reading in and does a search/replace based on the match. Currently I'm

Re: searching and replacing

2005-03-11 Thread FlashMX
Why does this syntax not work? The $1 does not come out. if (/([0-9.]{6}) set/) { s/$1 set/\n-50.2 v \n$1 set/; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: searching and replacing

2005-03-11 Thread Stone
if (/([0-9.]{6}) set/) { s/$1 set/\n-50.2 v \n$1 set/; You need to escape the period or it will match any character but newline. As it is right now you'll match .FANTA, which isn't what you want. Why does this syntax not work? The $1 does not come out. You

Re: searching and replacing

2005-03-11 Thread John W. Krahn
Stone wrote: if (/([0-9.]{6}) set/) { s/$1 set/\n-50.2 v \n$1 set/; You need to escape the period or it will match any character but newline. As it is right now you'll match .FANTA, which isn't what you want. A character class is not the same as a regular

Searching and replacing text

2004-08-02 Thread Chris Richards
Hi Everyone, This is my first post to the list Please be gentle :) Just so we are all clear... I am completely lost right from the start with this one. It is far beyond my current Perl skills and I need some serious help :) I want to create a script that searches file_b for the first entry

Re: Searching and replacing text

2004-08-02 Thread Gunnar Hjalmarsson
Chris Richards wrote: This is my first post to the list Please be gentle :) Sure. Just so we are all clear... I am completely lost right from the start with this one. It is far beyond my current Perl skills Oh? and I need some serious help :) Then, this is the most serious (and gentle) help I

RE: Searching and replacing text

2004-08-02 Thread Chris Richards
Fair enough. -Chris -Original Message- From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED] Sent: Monday, 2 August 2004 10:08 PM To: [EMAIL PROTECTED] Subject: Re: Searching and replacing text Chris Richards wrote: This is my first post to the list Please be gentle :) Sure. Just

Re: Searching and replacing text

2004-08-02 Thread Zeus Odin
Could you post the code you have written thus far? It would be a great help. -ZO Chris Richards [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi Everyone, This is my first post to the list Please be gentle :) Just so we are all clear... I am completely lost right from the start