wrote:
: How to extract part of the text (htm) file after start word until end word?
: start word is <! start >
: end word is <! end>
: Eg: some. html
: -----------------------------------
: not interested part of file...
: not interested part of file... <! start >Interested
: part
: 123456789<! end> not interested part..
: ------------------------------------
Slurp your file in paragraph mode (search perldoc perlvar) by saying
local $/;
local $_ = <FH>;
if ( /<! start>(.*)<! end>/ ) {
$text=$1;
}
print $text;
Build a loop around this construct if you have more than one start..end
segment per file.
Oliver.
--
Dr. Oliver Corff e-mail: