Home > Archive > PERL Beginners > August 2004 > Searching and replacing text
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Searching and replacing text
|
|
| Chris Richards 2004-08-03, 9:02 am |
| 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 in
file_a (router1 in the below example) and once it finds it I would like
it to change the next occurrence of "Parent Submap: Any string" to
"Parent Submap: second entry in file_a (site1 in the below example)"
It would also need to be case-insensitive.=20
Can anyone give me a huge push in the right direction?=20
Thank you.=20
-Chris
-------------------------------------
External files:=20
file_a - list of routers and their location
Eg:=20
router1,site1
file_b - output from an openview map export, contains 1000's of entries
like the below example.=20
Eg:=20
SYMBOL: ROUTER1
Object Type: 4
Parent Submap: IP Internet
Symbol Type: cisco Router:cisco-Rtr1720Family
Label: ROUTER1
Symbol Position: 1:11764x11691+7126+653
Hidden Value: FALSE
Submap Exists: TRUE
Background Graphics:=20
Layout Style: 2
Layout On: TRUE
Submap Overlay: TRUE
Show Connection Labels: FALSE
END SYMBOL
| |
| Gunnar Hjalmarsson 2004-08-03, 9:02 am |
| 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 can think of:
http://learn.perl.org/
<job specification snipped>
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
| |
| Chris Richards 2004-08-03, 9:02 am |
| Fair enough.
-Chris
-----Original Message-----
From: Gunnar Hjalmarsson [mailto:noreply@gunnar.cc]=20
Sent: Monday, 2 August 2004 10:08 PM
To: beginners@perl.org
Subject: Re: Searching and replacing text
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=20
> 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 can think of:
http://learn.perl.org/
<job specification snipped>
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org For additional
commands, e-mail: beginners-help@perl.org <http://learn.perl.org/>
<http://learn.perl.org/first-response>
| |
| Zeus Odin 2004-08-03, 9:02 am |
| Could you post the code you have written thus far? It would be a great help.
-ZO
"Chris Richards" <chrisric@routemaster.net> wrote in message
news:6AE9C6286E5CEA4CB504C9BACCB487162F9
8@gir2.routemaster.net...
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 in
file_a (router1 in the below example) and once it finds it I would like
it to change the next occurrence of "Parent Submap: Any string" to
"Parent Submap: second entry in file_a (site1 in the below example)"
It would also need to be case-insensitive.
|
|
|
|
|