Going with HTML Formattext, I ran the script and it works.
It displays the text. Now I have a twofold problem:
1) One HTML had tables and the end results was partially good.
The text was displayed but the data inside of the tables were
not shown:
Text
TABLE NOT SHOWN
2) I want to save the text. So, I tried to following script.
It worked (displayed the text but when I viewed the file afterwards,
it was completly blank. Please help me obi-wan! Thanks,
you guys are the best :)
-Dave
require HTML::TreeBuilder;
$tree = HTML::TreeBuilder->new->parse_file("test.htm");
require HTML::FormatText;
$formatter = HTML::FormatText->new(leftmargin => 0,
rightmargin => 50);
open FH, ">test.htm" or die $1;
print $formatter->format($tree);
close FH or die $1;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.