LinuxQuestions.org
Review your favorite Linux distribution.
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 08-04-2009, 09:36 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
GNU program to do HTML to ASCII conversion?


Hi.

I new the name of a program capable of converting HTML format to plain
ascii. However, I've quite fogotten it. I did 'apropos html | grep -i
ascii' or 'apropos ascii | less john' and I didn't find anything. Any
sugestion will be wellcome. Thanks for your time.
 
Old 08-05-2009, 12:29 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Possibly http://comp.eonworks.com/scripts/scripts.html
http://linux.softpedia.com/downloadTag/HTML2TXT
in fact google html2txt brings up a stack of options
 
1 members found this post helpful.
Old 08-05-2009, 08:20 AM   #3
rkirk
LQ Newbie
 
Registered: Apr 2009
Posts: 26

Rep: Reputation: 23
Well, if you specifically want ASCII, then you'll need to call the html2text(1) command with the -ascii flag.

Code:
html2text -ascii INPUTFILE.html > OUTPUTFILE.txt
But it's not a perfect solution. Anything between php brackets (<?php ?>) is left in the converted file. html2text seems to only remove obvious HTML tags, and this might not result in the kind of text files that you really want.

Last edited by rkirk; 08-05-2009 at 08:21 AM.
 
1 members found this post helpful.
Old 08-05-2009, 09:16 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
How about plain 'ol 'links -dump somefile.html > somefile.text'?
 
1 members found this post helpful.
Old 08-07-2009, 07:01 AM   #5
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
links works fine, as it should be. Thanks and good bye.
 
  


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
Converting html to ascii? stf92 Linux - Software 11 05-28-2009 11:09 AM
Conversion from EBCDIC to ASCII aravindts Programming 2 06-27-2007 03:05 PM
How do I enable the ASCII conversion chart characters Thane Ubuntu 5 06-01-2007 06:33 PM
HTML to XHTML conversion rjlee Linux - Software 3 01-10-2005 07:27 AM
gnu c++ compiler and ascii tekmorph Programming 6 10-26-2004 09:13 AM

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

All times are GMT -5. The time now is 07:10 PM.

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