B
Bill H
Does anyone have an easy/fast way of removing HTML tags from a text
file using perl? I am using the following brute force way of doing it,
which does work, but can be a little slow:
$body = substr($body,0,$a);
while(index($body,"<") != -1)
{
$a = index($body,"<");
$beg = substr($body,0,$a);
$body = substr($body,$a + 1)." ";
$a = index($body,">");
$fin = substr($body,$a + 1);
$body = $beg.$fin;
}
$body =~ s/ / /gi;
file using perl? I am using the following brute force way of doing it,
which does work, but can be a little slow:
$body = substr($body,0,$a);
while(index($body,"<") != -1)
{
$a = index($body,"<");
$beg = substr($body,0,$a);
$body = substr($body,$a + 1)." ";
$a = index($body,">");
$fin = substr($body,$a + 1);
$body = $beg.$fin;
}
$body =~ s/ / /gi;