Fedora Linux Support Community & Resources Center
  #1  
Old 13th December 2006, 05:01 PM
Nkunzis Offline
Registered User
 
Join Date: Dec 2006
Posts: 8
Convert a plain Text into HTML format

Hi Everyone
I want to change the format of my output file from plain text into an HTML format.is there any command or any way to do it?

Thanks
Reply With Quote
  #2  
Old 13th December 2006, 05:31 PM
Detonate Offline
Registered User
 
Join Date: Dec 2005
Location: Ault, Colorado, USA
Age: 72
Posts: 144
Quick way. Open the file in Openoffice, save as html.
Reply With Quote
  #3  
Old 13th December 2006, 05:32 PM
sideways's Avatar
sideways Offline
Retired User
 
Join Date: Oct 2004
Location: London, UK
Posts: 4,999
enscript can do this too

although the manual page seems a bit out of date (the -W option doesn't works as stated)

assume your output file is called file.txt

then

Code:
enscript --language=html -pfile.html file.txt
will convert it to html.

you can do much more sophisticated stuff. eg if you have a folder full of c source files (and headers) you can produce a nice html summary page of the whole project with

Code:
enscript -E --color --language=html --toc -pmyproject.html *.h *.c
(and you can convert to serveral other popular formats too)

Last edited by sideways; 13th December 2006 at 05:35 PM.
Reply With Quote
  #4  
Old 13th December 2006, 08:42 PM
Nkunzis Offline
Registered User
 
Join Date: Dec 2006
Posts: 8
Quote:
Originally Posted by sideways
enscript can do this too

although the manual page seems a bit out of date (the -W option doesn't works as stated)

assume your output file is called file.txt

then

Code:
enscript --language=html -pfile.html file.txt
will convert it to html.

you can do much more sophisticated stuff. eg if you have a folder full of c source files (and headers) you can produce a nice html summary page of the whole project with

Code:
enscript -E --color --language=html --toc -pmyproject.html *.h *.c
(and you can convert to serveral other popular formats too)
Thanks alot . but there is a problem
when i use the cat shell command to show the html file the content including the htlm codea appear.on the screen.
my question is how can i show the file like a normal page without the html codes( as it web pages do. )

thank alot
Reply With Quote
  #5  
Old 13th December 2006, 08:58 PM
BandC's Avatar
BandC Offline
Registered User
 
Join Date: Nov 2004
Posts: 1,105
Nkunzis,

Maybe you need to explain your problem a little more. A file saved with the .html extension viewed in a browser would be rendered and shown as an HTML page.

If the file includes HTML markup <br /> etc. then when you display the contents of the file in an editor it will show the markup too. You can't have it both ways in one file. If you need both ways, then you need two versions of your file one HTML and one plain text.
__________________
IMHO GNOME FTW! BTW KDE WAD? FWIW. HTH. AFAIK YMMV. OMG WTF BBQ! :rolleyes:

Do you like surfing forums but wish people would stop using obscure abbreviations and acronyms?
Then my Firefox/Chrome extension ABBREX is for you!
It automatically adds hover tooltips to abbreviations displaying their meanings on any web page you visit!

Check it out at: http://abbrex.com
Reply With Quote
  #6  
Old 14th December 2006, 11:00 AM
sideways's Avatar
sideways Offline
Retired User
 
Join Date: Oct 2004
Location: London, UK
Posts: 4,999
As BandC says, i'm confused about what you want here?

the original text file will display using cat!

why view a web page (html page) using cat?

html pages are viewed using a browser, in firefox you can just select

File->Open File

and then browse to the desired html file, it will display lovely!
Reply With Quote
Reply

Tags
convert, format, html, plain, text

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
convert pdf to text/html g4864149 Using Fedora 4 1st November 2007 12:06 PM
how to convert html,doc,xls,... to text? myname74119 Using Fedora 1 4th April 2007 05:27 AM
Plain Text from Sendmail Perfect Storm Servers & Networking 6 13th January 2007 04:59 PM


Current GMT-time: 12:34 (Saturday, 25-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat