take the price info from a line

J

jenson

I use wget to download a web page.
Now I need to extract the price info from the following line.

Prev Close:</td><td class="yfnc_tabledata1">4.83</td></tr><tr><td
class="yfnc_tablehead1" width="48%">Open:</td><td
class="yfnc_tabledata1">4.85</td></tr><tr><td class="yfnc_tablehead1"
width="48%">Bid:

Question:
1. How can I get a value between 2 pattern within a line? (My intention is
to get the value 4.83)
e.g. pattern1 is Prev Close:</td><td
class="yfnc_tabledata1">
pattern2 is </td></tr><tr><td
class="yfnc_tablehead1" width="48%">Open:





Any help is much appreciated.

Jenson
 
G

Gunnar Hjalmarsson

jenson said:
I use wget to download a web page.
Now I need to extract the price info from the following line.

Prev Close:</td><td class="yfnc_tabledata1">4.83</td></tr><tr><td
class="yfnc_tablehead1" width="48%">Open:</td><td
class="yfnc_tabledata1">4.85</td></tr><tr><td class="yfnc_tablehead1"
width="48%">Bid:

Question:
1. How can I get a value between 2 pattern within a line? (My intention is
to get the value 4.83)

You can use a module and/or a regular expression.

perldoc -q "remove HTML"

perldoc perlrequick

If you encounter problems, please feel free to post the code you have.
Don't post it here, though, but at comp.lang.perl.misc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top