Welcome Guest, Not a member yet? Register   Sign In
How do you parse a file and pull a block of markup?
#13

[eluser]Sen Hu[/eluser]
Good question. Excellent responses so far.

Here is an alternate. You want to extract block-i-need-to-get from

Quote:...bunch of markups...
<div id="block-i-need-to-get">
<div>some content</div>
<div>some more content</div>
</div>
...more bunch of markups...

in file "someremotefile" ? (BTW: Thanks for accurately posting your requirements.)

Here is a small script.

Code:
var str content ; cat "[b]someremotefile[/b]" > $content
stex -c "^<div id=\"^]" $content > null
stex -c "[^\"^" $content > null
# What's remaining in $content is block-i-need-to-get . Print it.
echo $content

This script is written in biterscripting ( http://www.biterscripting.com/install.html ) . You can transform it to php.

Sen


Messages In This Thread
How do you parse a file and pull a block of markup? - by El Forum - 05-03-2009, 06:26 PM
How do you parse a file and pull a block of markup? - by El Forum - 05-03-2009, 06:44 PM
How do you parse a file and pull a block of markup? - by El Forum - 05-04-2009, 01:31 AM
How do you parse a file and pull a block of markup? - by El Forum - 05-04-2009, 04:45 AM
How do you parse a file and pull a block of markup? - by El Forum - 05-04-2009, 04:47 AM
How do you parse a file and pull a block of markup? - by El Forum - 05-04-2009, 04:57 AM
How do you parse a file and pull a block of markup? - by El Forum - 05-04-2009, 05:03 AM
How do you parse a file and pull a block of markup? - by El Forum - 05-04-2009, 05:04 AM
How do you parse a file and pull a block of markup? - by El Forum - 05-04-2009, 12:53 PM
How do you parse a file and pull a block of markup? - by El Forum - 05-04-2009, 12:59 PM
How do you parse a file and pull a block of markup? - by El Forum - 05-04-2009, 03:13 PM
How do you parse a file and pull a block of markup? - by El Forum - 05-04-2009, 07:19 PM
How do you parse a file and pull a block of markup? - by El Forum - 05-27-2009, 09:38 AM
How do you parse a file and pull a block of markup? - by El Forum - 05-27-2009, 09:57 AM
How do you parse a file and pull a block of markup? - by El Forum - 05-27-2009, 10:01 AM
How do you parse a file and pull a block of markup? - by El Forum - 05-27-2009, 10:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB