THANK YOU! THANK YOU! THANK YOU!
I will be studying this code (I've already tried it out and saw that it works
"as advertised") and trying different permutations.
Also, I wanted to thank you for the super speedy reply! I have recieved several
responses (all instructional), and I've not even been on the list for 12 hours
yet?!?
cool.
--- [EMAIL PROTECTED] wrote:
> Hi Steve,
...
>
> Now for number 2:
> >Problem: I need to parse an HTML page and pull values out of certain
> fields for
> >later analysis. Can this be done with 'parse and if so, how?
> >
> >Sample Data:
> ><TABLE>
> ><TR><TD>ALPHA</TD><TD>ONE</TD></TR>
> ><TR><TD>BETA</TD><TD>TWO</TD></TR>
> ><TR><TD COLSPAN=2>DUMMY LINE ONE</TD></TR>
> ><TR><TD>GAMMA</TD><TD>THREE</TD></TR>
> ><TR><TD>DELTA</TD><TD>FOUR</TD></TR>
> ><TR><TD COLSPAN=2>DUMMY LINE TWO</TD></TR>
> ><TR><TD>EPSILON</TD><TD>FIVE</TD></TR>
> ></TABLE>
> >
> >Desired output:
> >ALPHA = ONE
> >BETA = TWO
> >GAMMA = THREE
> >DELTA = FOUR
> >EPSILON = FIVE
> >
>
> try:
> REBOL []
>
> row-open: false
> found-first: false
> found-second: false
>
> value-first: {}
> value-second: {}
>
> result: copy {}
>
> parse-string: {
> <TABLE>
> <TR><TD>ALPHA</TD><TD>ONE</TD></TR>
> <TR><TD>BETA</TD><TD>TWO</TD></TR>
> <TR><TD COLSPAN=2>DUMMY LINE ONE</TD></TR>
> <TR><TD>GAMMA</TD><TD>THREE</TD></TR>
> <TR><TD>DELTA</TD><TD>FOUR</TD></TR>
> <TR><TD COLSPAN=2>DUMMY LINE TWO</TD></TR>
> <TR><TD>EPSILON</TD><TD>FIVE</TD></TR>
> </TABLE>
> }
>
>
>
> parse parse-string [
> some [
> ["<TR><TD>" copy text-1 to "</TD>" thru "<TD>" copy text-2 to
> "</TD></TR>"
> (append result reduce [text-1 "=" text-2 newline])
> ]
> |
> ["<TR>" thru "</TR>"]
> |
> skip
> ]
> ]
>
> Hope this helps
>
>
> ;- Elan >> [: - )]
>
>
=====
Steve ~runester~ Jarjoura
"According to my calculations, that problem doesn't exist."
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com