I am looking to replace a nasty shell script that uses awk to trim down some HTML. The problem is I cannot find anything in Perl that does the aforementioned function
awk '/<TABLE\ WIDTH\=\"100\%\" BORDER\=1\ CELLSPACING\=0><TR\ class\=\"tabhead\"><TH>State<\/TH>/,/END/'
How can I do this in Perl?
the expected output would be
<TABLE WIDTH="100%" BORDER=1 CELLSPACING=0><TR class="tabhead"><TH>State</TH>
The Perl flipflop operator gives me WAY more. (Everything between the asterisks is junk)
*<h2>Browse Monitors (1 out of 497)</h2><br><font size="-1" style="font-weight:normal"> Use the <A HREF=/SiteScope/cgi/go.exe/SiteScope?page=monitorSummary&account=login15 >Monitor Description Report</a> to view current monitor configuration settings.</font>*<TABLE WIDTH="100%" BORDER=1 CELLSPACING=0><TR class="tabhead"><TH>State</TH>
I think this will work:
expr1 .. expr2will be false until it encounters a line whereexpr1is true.Then it will be true until it encounters a line where
expr2is true.Update: if you need to trim the non-matching text from the front of the first matching line, this will work
or
if TEXT is a long string that you only want to type once. The change will edit the line while it does the pattern match.