The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
extract data from html tables Streetrcr UNIX for Dummies Questions & Answers 8 03-20-2008 06:14 AM
coverting html data to text in 'c' phani_sree High Level Programming 3 10-18-2007 10:06 AM
HTML message with attachment (text-file) Felix2511 UNIX for Dummies Questions & Answers 2 09-12-2007 02:59 AM
html - text file question frustrated1 Shell Programming and Scripting 5 09-21-2005 05:23 AM
linking unix generated text file to html page alexd Shell Programming and Scripting 1 11-13-2002 12:21 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-20-2005
los111 los111 is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 2
How do I extract text only from html file without HTML tag

I have a html file called myfile. If I simply put "cat myfile.html" in UNIX, it shows all the html tags like <a href=r/26><img src="http://www>. But I want to extract only text part.

Same problem happens in "type" command in MS-DOS.

I know you can do it by opening it in Internet Explorer, then "save as text", then open it again. But I need to do this from UNIX, as I have thousands of html files and have no time to convert them to text files one by one. I went through many books, but can't find a way. I would really appreciate your help.
  #2 (permalink)  
Old 09-20-2005
LanceBoyles LanceBoyles is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 8
Use Lynx with the --dump option, like this:

lynx --dump myfile.html > myfile.txt

OR

lynx --dump http://some.where.com/whatever.html > myfile.txt

You can write a shell script that will do this for many files without you having to touch it.
  #3 (permalink)  
Old 09-20-2005
los111 los111 is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 2
thanks

Thanks a lot! I will try this. I never used lynx before, but I hope my Fedora Core already has it.
  #4 (permalink)  
Old 11-28-2007
ali560045's Avatar
ali560045 ali560045 is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 328
same problem

i have a script in ksh called file1

#!/bin/ksh

cat my.html

---------------------------
and a html file hy.html

can u tell me that if i execute "file1" script it will open hy.html bt here it is showing the all the tags along with text.........

it should open the browser part only.......

plz help,any command
  #5 (permalink)  
Old 11-28-2007
infyanurag infyanurag is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 64
Quote:
Originally Posted by LanceBoyles View Post
Use Lynx with the --dump option, like this:

lynx --dump myfile.html > myfile.txt

OR

lynx --dump http://some.where.com/whatever.html > myfile.txt

You can write a shell script that will do this for many files without you having to touch it.
hi

i can not get the lynx command on linux.
what should i do?
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 03:11 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0