Thread: taking some words out of buffer

  1. #1
    Registered User
    Join Date
    Dec 2004
    Location
    The Netherlands
    Posts
    91

    taking some words out of buffer

    hello everyone!
    I am stuck and looking for some help,
    I have this in a buffer ->

    Code:
    <table border=0 width="100%" cellspacing=0 cellpadding=0>
    <tr><td colspan=2><table width="100%" border=0 cellspacing=0 cellpadding=1><tr><td id="releases_tableborder"><table width="100%" border=0 cellspacing=0 cellpadding=0><tr id="releases_header"><td align="center"><a href="/index.php?sortname=0" title="Sort on Date">added</a></td><td align="center" width="45%"><a href="/index.php?sortname=1" title="Sort on Name">file</a></td><td align="center">group</td><td align="center">size</td><td align="center">   ul   </td><td align="center">   dl   </td><td align="center">details</td><td align="center"><span title="series"> </span></td></tr><tr><td colspan="8" height=1 id="releases_darkseperator"><img src="/images/pixel.gif" width="1" height="1" hspace="0" vspace="0" border="0" alt=""></td></tr><tr class="releases_rowstyle_light"><td align="center" nowrap> 02-26 . 08:10</td>
    
    <td width="45%" nowrap id="releases_link"><img src="/images/pixel.gif" width=11 height=1 border=0> <a target="_blank" href="http://a.scarywater.net/akeep/">Beet the Vandel Buster <b>11</b></a><td align="center" nowrap> <a href="/group.php/4.html">Anime-Keep</a></td>
    <td align="center" nowrap> 174.4 Mb. </td><td align="center"><b><span id="releases_seedgood">574</span></b></td><td align="center"><b>1561</b></td>
    <td align="center"> <a href="/details.php/11434.html">Details</a> </td>
    <td align="center"><a href="/series.php/491.html"><img src="/images/series_more.gif" width=5 height=10 border=0 align="absmiddle" alt="Show all torrents for Beet the Vandel Buster"></a> </td>
    </tr>
    <tr class="releases_rowstyle_dark"><td align="center" nowrap> 02-26 . 07:47</td>
    <td width="45%" nowrap id="releases_link"><img src="/images/pixel.gif" width=11 height=1 border=0> <a target="_blank" href="http://a.scarywater.net/c1anime/">Harukanaru Toki no Naka de ~Hachiyoushou~ <b>4</b></a><td align="center" nowrap> <a href="/group.php/209.html">C1Anime</a></td>
    
    <td align="center" nowrap> 207.1 Mb. </td><td align="center"><b><span id="releases_seedgood">15</span></b></td><td align="center"><b>53</b></td>
    <td align="center"> <a href="/details.php/11433.html">Details</a> </td>
    <td align="center"><a href="/series.php/500.html"><img src="/images/series_more.gif" width=5 height=10 border=0 align="absmiddle" alt="Show all torrents for Harukanaru Toki no Naka de ~Hachiyoushou~"></a> </td>
    </tr>
    <tr class="releases_rowstyle_light"><td align="center" nowrap> 02-26 . 06:47</td>
    <td width="45%" nowrap id="releases_link"><img src="/images/pixel.gif" width=11 height=1 border=0> <a target="_blank" href="http://a.scarywater.net/akeep/">Rozen Maiden <b>9</b></a><td align="center" nowrap> <a href="/group.php/4.html">Anime-Keep</a></td>
    <td align="center" nowrap> 175.0 Mb. </td><td align="center"><b><span id="releases_seedgood">177</span></b></td><td align="center"><b>368</b></td>
    
    <td align="center"> <a href="/details.php/11432.html">Details</a> </td>
    <td align="center"><a href="/series.php/479.html"><img src="/images/series_more.gif" width=5 height=10 border=0 align="absmiddle" alt="Show all torrents for Rozen Maiden"></a> </td>
    </tr>
    <tr class="releases_rowstyle_dark"><td align="center" nowrap> 02-26 . 06:46</td>
    <td width="45%" nowrap id="releases_link"><img src="/images/pixel.gif" width=11 height=1 border=0> <a target="_blank" href="http://a.scarywater.net/akeep/">Bleach <b>14</b></a><td align="center" nowrap> <a href="/group.php/4.html">Anime-Keep</a></td>
    <td align="center" nowrap> 174.8 Mb. </td><td align="center"><b><span id="releases_seedgood">201</span></b></td><td align="center"><b>373</b></td>
    <td align="center"> <a href="/details.php/11431.html">Details</a> </td>
    <td align="center"><a href="/series.php/496.html"><img src="/images/series_more.gif" width=5 height=10 border=0 align="absmiddle" alt="Show all torrents for Bleach"></a> </td>
    
    </tr>
    and now, I try to filter the following out: "Beet the Vandel Buster", "Harukanaru Toki no Naka de ~Hachiyoushou~" "rozen maiden" and "Bleach".
    I tryed using strstr(buf, "Show all torrents for ") and strchr() to locate the next '>' and copy everything between but couldnt get it to work, im too confused.

    can someone show me how to do it , thanks

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    There are many ways to do this. One way perhaps would be to do something like this:
    Code:
    while not done with all of the text
        while not a '<', copy this character into a new buffer
        while not a '>', ignore or get rid of this character
    A linked list would work well for this. Create a new node, when you have something to put in it, do so until you reach a '<'. When you reach a '<', you're done with that node, so now skip everything (discard it) until you hit a '>'. Repeat until done.

    Like I said, there are many ways to do it, but they're all basicly the same process.

    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Lame null append cause buffer to crash
    By cmoo in forum C Programming
    Replies: 8
    Last Post: 12-29-2008, 03:27 AM
  2. writing a pack-style function, any advices?
    By isaac_s in forum C Programming
    Replies: 10
    Last Post: 07-08-2006, 08:09 PM
  3. Having Buffer Problems With Overlapped I/O --
    By Sargera in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 04:46 PM
  4. help, i cant count spaces or words
    By cdosrun in forum C Programming
    Replies: 2
    Last Post: 11-25-2005, 03:13 PM
  5. Console Screen Buffer
    By GaPe in forum Windows Programming
    Replies: 0
    Last Post: 02-06-2003, 05:15 AM