LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-27-2005, 08:15 PM   #1
lothario
Member
 
Registered: Apr 2004
Posts: 340

Rep: Reputation: 30
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.
 
Old 09-27-2005, 08:29 PM   #2
dmellem
Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 42

Rep: Reputation: 15
Well, there's txt2html (http://txt2html.sourceforge.net/) which uses the Perl module HTML::TextToHTML....

-Dan
 
Old 09-27-2005, 08:39 PM   #3
lothario
Member
 
Registered: Apr 2004
Posts: 340

Original Poster
Rep: Reputation: 30
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)
 
Old 09-27-2005, 08:48 PM   #4
dmellem
Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 42

Rep: Reputation: 15
Try

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.

-Dan

Last edited by dmellem; 09-27-2005 at 08:53 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert DOS text files to UNIX text files ta0kira Linux - Software 7 03-15-2011 11:42 AM
convert CSV (TEXT) files to UTF-16 cccc Programming 1 07-01-2004 01:54 AM
how to convert windows formatted text files to *nix formatting? zero79 Linux - General 8 06-11-2004 03:00 AM
extract text portions from html files linuxfond Programming 3 04-28-2004 11:00 AM
Convert Powerpoint files to txt,html..... devinWhalen Linux - Software 0 07-29-2003 12:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration