Replace a specific block of data



Hello again

Not too sure how to pose this question, but here goes.

Working on an html page.
There are many blocks of code placed between <tr> and </tr> in the page.

The block(s) I am playing with have seven lines of code placed between <tr> and </tr>, (repeated a number of times throughout the page) but which have specific differences to all the other blocks. The first being, each line in this block contains the word scope.
The second being, none of the other blocks contain any of the following data between ">" and "<"
line 1 contains >one<
line 2 contains >two<
line 3 contains >three<
line 4 contains >one<
line 5 contains >one<
line 6 contains >six<
line 7 contains >seven<

Using a method along the lines of the example given below, how would I (test and) replace only in this block?
(obviously, the following example changes every single instance, so I know it is totally wrong for the task).

open( F, $ARGV[0] );
while( <F> ) {
s!>one<!>two<!; # line 1
s!>two<!>three<!; # line 2
s!>three<!>four<!; # line 3
s!>one<!>two<!; # line 4
s!>one<!>five<!; # line 5
s!>six<!>twelve<!; # line 6
s!>seven<!>eight<!; # line 7
{
print;
}
}

I can paste a copy of the actual block of code if needed.

thanks
Brian
.



Relevant Pages

  • Re: Replace a specific block of data
    ... Jay Savage wrote: ... Not too sure how to pose this question, ... Working on an html page. ... Methinks I may have to look into playing with offsets. ...
    (perl.beginners)
  • Re: Replace a specific block of data
    ... Not too sure how to pose this question, ... Working on an html page. ... The blockI am playing with have seven lines of code placed between ... Parsing HTML is ...
    (perl.beginners)
  • Re: Insider Secrets Of Solving Sudoku Puzzles
    ... cube of the 21st century" or the "fastest growing puzzle in the ... Playing Sudoku is like playing Golf. ... Internet using Lotus Notes and Internet Explorer. ... do HTML, JavaScript, and whatever else. ...
    (rec.puzzles)
  • xpath questions...
    ... playing around with xpath and the html dom... ... i can create a test xpath: ... work when i was playing around with xpather on firefox.. ...
    (comp.lang.python)
  • Re: How to render HTML as text (like lynx does) ?
    ... > I've been playing around with a lot of modules but can't find ... > one that simply represents HTML as text, laying out the tables ... Prev by Date: ...
    (comp.lang.perl.modules)