-   Linux - Software (
-   -   Convert text files to html files (

lothario 09-27-2005 09:15 PM

Convert text files to html files
I have a bunch of plain text files.
Need to convert them into corresponding HTML pages.

Is there some command that I can use (in a shell script) to convert:

abc.txt to abc.html
def.txt to def.html
xyz.txt to xyz.html

I would like to preserve the line breaks, paragraphs, punctuation, etc.

dmellem 09-27-2005 09:29 PM

Well, there's txt2html ( which uses the Perl module HTML::TextToHTML....


lothario 09-27-2005 09:39 PM

This looks good but it is not installed on this host:

which txt2html

/usr/bin/which: no txt2html in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin)

dmellem 09-27-2005 09:48 PM


perl -e 'use HTML::TextToHTML;'

and see if you get an error. If you do, you'll need to use CPAN or some other method to get the module.

Just download the tarball with:

untar it and follow the README. There's nothing to compile and it can run in your home directory.


All times are GMT -5. The time now is 05:46 PM.