LinuxQuestions.org
Visit Jeremy's Blog.
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, 10:36 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,071

Rep: Reputation: 59
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, 01:29 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.10, Centos 7.5
Posts: 17,710

Rep: Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520
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, 09: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 09:21 AM.
 
1 members found this post helpful.
Old 08-05-2009, 10:16 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

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

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

All times are GMT -5. The time now is 11:55 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration