f



only get data from "today" until "yesterday"

Hi, 

I will get only the code from the date "today" (should be displayed)
until "yesterday" (shouldn't be displayed)

This is the source code (all in ONE line): 
Quote: 
......muchHTMLcodeBefore...TR><TD ALIGN="RIGHT" class=bcText>
01/27/04</TD><TD ALIGN="RIGHT" class=bcText> 1154.25</TD><TD
ALIGN="RIGHT" class=bcText> 1154.75</TD><TD ALIGN="RIGHT"
class=bcText> 1151.00</TD><TD ALIGN="RIGHT" class=bcText>
1151.50</TD><TD ALIGN="RIGHT" class=bcTextRed>
-2.75</TD></TR></TABLE><TABLE WIDTH="100%" BORDER=0 CELLPADDING=2
CELLSPACING=1><TR><TD WIDTH="16.6666666666667%" ALIGN="RIGHT"
class=bcText>01/26/04</TD...and so on (all in one line)

I can regexp the html code with: 

[regsub -all {<[^>]*>} $line {} line] 

But how can I get only the data from the actual date (here 01/27/04)
to yesterday (here 01/26/04).

Thanks!
0
jagg1 (15)
1/28/2004 7:28:15 AM
comp.lang.tcl 23428 articles. 2 followers. Post Follow

4 Replies
9305 Views

Similar Articles

[PageSpeed] 20

Not sure what you ask, but

   regexp {.*?(01/26/04.*?)01/27/04} $line dummy stuff

might give you what you're looking for in $staff

hth
Ronnie

jagg wrote:
> Hi, 
> 
> I will get only the code from the date "today" (should be displayed)
> until "yesterday" (shouldn't be displayed)
> 
> This is the source code (all in ONE line): 
> Quote: 
> .....muchHTMLcodeBefore...TR><TD ALIGN="RIGHT" class=bcText>
> 01/27/04</TD><TD ALIGN="RIGHT" class=bcText> 1154.25</TD><TD
> ALIGN="RIGHT" class=bcText> 1154.75</TD><TD ALIGN="RIGHT"
> class=bcText> 1151.00</TD><TD ALIGN="RIGHT" class=bcText>
> 1151.50</TD><TD ALIGN="RIGHT" class=bcTextRed>
> -2.75</TD></TR></TABLE><TABLE WIDTH="100%" BORDER=0 CELLPADDING=2
> CELLSPACING=1><TR><TD WIDTH="16.6666666666667%" ALIGN="RIGHT"
> class=bcText>01/26/04</TD...and so on (all in one line)
> 
> I can regexp the html code with: 
> 
> [regsub -all {<[^>]*>} $line {} line] 
> 
> But how can I get only the data from the actual date (here 01/27/04)
> to yesterday (here 01/26/04).
> 
> Thanks!


-- 

----------------------------------------------------------------------
Ronnie Brunner                             ronnie.brunner@netcetera.ch
Netcetera AG, 8040 Zuerich   phone +41 1 247 79 79 fax +41 1 247 70 75

0
1/28/2004 9:36:28 AM
You might want to take a look at the htmlparse package in tcllib as a starting 
point (plus rolling your own simple state machine).

jagg wrote:

> Hi, 
> 
> I will get only the code from the date "today" (should be displayed)
> until "yesterday" (shouldn't be displayed)
> 
> This is the source code (all in ONE line): 
> Quote: 
> .....muchHTMLcodeBefore...TR><TD ALIGN="RIGHT" class=bcText>
> 01/27/04</TD><TD ALIGN="RIGHT" class=bcText> 1154.25</TD><TD
> ALIGN="RIGHT" class=bcText> 1154.75</TD><TD ALIGN="RIGHT"
> class=bcText> 1151.00</TD><TD ALIGN="RIGHT" class=bcText>
> 1151.50</TD><TD ALIGN="RIGHT" class=bcTextRed>
> -2.75</TD></TR></TABLE><TABLE WIDTH="100%" BORDER=0 CELLPADDING=2
> CELLSPACING=1><TR><TD WIDTH="16.6666666666667%" ALIGN="RIGHT"
> class=bcText>01/26/04</TD...and so on (all in one line)
> 
> I can regexp the html code with: 
> 
> [regsub -all {<[^>]*>} $line {} line] 
> 
> But how can I get only the data from the actual date (here 01/27/04)
> to yesterday (here 01/26/04).
> 
> Thanks!

-- 
+--------------------------------+---------------------------------------+
| Gerald W. Lester               | "The man who fights for his ideals is |
| Gerald.Lester@cox.net          |  the man who is alive." -- Cervantes  |
+--------------------------------+---------------------------------------+

0
Gerald.Lester (2014)
1/28/2004 2:34:06 PM
Ronnie Brunner <ronnie.brunner@netcetera.ch> wrote in message news:<4017829c$0$725$5402220f@news.sunrise.ch>...
> Not sure what you ask, but
> 
>    regexp {.*?(01/26/04.*?)01/27/04} $line dummy stuff
> 
> might give you what you're looking for in $staff
> 
> hth
> Ronnie

....from today until yesterday, must it be

regexp {.*?(01/27/04.*?)01/26/04} $line dummy stuff

?

Ok, this date is changing daily of course. Can I make set two vars
like $today and $yesterday which gives me the actual dates and say

regexp {.*?($today.*?)$yesterday} $line dummy stuff

?

Thanks
0
jagg1 (15)
1/28/2004 2:42:14 PM

jagg wrote:

> Ronnie Brunner <ronnie.brunner@netcetera.ch> wrote in message news:<4017829c$0$725$5402220f@news.sunrise.ch>...
> 
>>Not sure what you ask, but
>>
>>   regexp {.*?(01/26/04.*?)01/27/04} $line dummy stuff
>>
>>might give you what you're looking for in $staff
>>
>>hth
>>Ronnie
> 
> 
> ...from today until yesterday, must it be
> 
> regexp {.*?(01/27/04.*?)01/26/04} $line dummy stuff
> 
> ?
> 
> Ok, this date is changing daily of course. Can I make set two vars
> like $today and $yesterday which gives me the actual dates and say
> 
> regexp {.*?($today.*?)$yesterday} $line dummy stuff
> 

yes you can, but use "" instead of {} or it won't substitute
those variables and you won't get any matches

bruce

0
bruce-news (900)
1/28/2004 2:54:32 PM
Reply: