read txt from multiple html files???
#1
Scooby Regular
Thread Starter
Join Date: Aug 2001
Location: wakefield
Posts: 2,082
Likes: 0
Received 0 Likes
on
0 Posts
we have 600 html files that contain text that needs to be exported into 1 readable file of any format......
does anyone know how this can be done ??
cheers
shunty
does anyone know how this can be done ??
cheers
shunty
#6
Scooby Regular
Thread Starter
Join Date: Aug 2001
Location: wakefield
Posts: 2,082
Likes: 0
Received 0 Likes
on
0 Posts
knit one perl one
hello steve, have you got something already done ??
heres one you made earlier - perl2exe
I'm sure I would have something in exchange
shunty
hello steve, have you got something already done ??
heres one you made earlier - perl2exe
I'm sure I would have something in exchange
shunty
#7
Scooby Regular
From HTML::TokeParser::Simple (search.cpan.org), assuming 5.6.x or earlier:
#!/usr/local/bin/perl -w
use strict;
use HTML::TokeParser::Simple;
my $p = HTML::TokeParser::Simple->new( $somefile );
while ( my $token = $p->get_token ) {
# This prints all text in an HTML doc (i.e., it strips the HTML)
next unless $token->is_text;
print $token->as_is;
}
If that's too high a level you can use HTML::TokeParser. 'Course you'll have to modify this to iterate over all your files and put the filename in $somefile, which will have to be relatively or absolutely pathed.
(aren't there any [CODE] tags?)
[Edited by stevencotton - 6/5/2003 8:47:18 PM]
#!/usr/local/bin/perl -w
use strict;
use HTML::TokeParser::Simple;
my $p = HTML::TokeParser::Simple->new( $somefile );
while ( my $token = $p->get_token ) {
# This prints all text in an HTML doc (i.e., it strips the HTML)
next unless $token->is_text;
print $token->as_is;
}
If that's too high a level you can use HTML::TokeParser. 'Course you'll have to modify this to iterate over all your files and put the filename in $somefile, which will have to be relatively or absolutely pathed.
(aren't there any [CODE] tags?)
[Edited by stevencotton - 6/5/2003 8:47:18 PM]
Trending Topics
Thread
Thread Starter
Forum
Replies
Last Post
Wingnuttzz
Member's Gallery
30
26 April 2022 11:15 PM
Mattybr5@MB Developments
Full Cars Breaking For Spares
38
17 July 2016 10:43 PM
Mattybr5@MB Developments
Full Cars Breaking For Spares
20
22 October 2015 06:12 AM