Complext test extraction

Hi All,

Got a bit of a complex grep/awk statement here.

Trying to write a statement which finds the following text in an unstructured HTML file: eg

original file snip:

<form style="margin-top: 0px; margin-bottom: 0px;" name="ladder">
<select class="formtext" size="1" onchange="jumper(document.ladder.lst.options[document.ladder.lst.selectedIndex].value)" name="lst" style="width: 610px;"><option value="/testing/testSearch.cfm?searchClass=agent&idd=1&more=1&alphabetical=1&letter=Y&whichsearch=ress#ycco">Page 1: Test String here

                                                    &lt;/option&gt;&lt;/select&gt;      
                                            &lt;/form&gt;

<end snip>

The only text I care about is getting the following (see the end of the 4th line)

"ycco" "Test String here"

Note that the above can be any text, so I can't just grep for them. I know that "ress#" is definitely there though.

Any ideas?

ahhh...got it!

grep ress# test.dat | awk '{ FS="#" } { print $2 }' | sed 's/"/:/g' | awk '{ FS=":"} { print $1 $3}'