LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-05-2011, 12:38 PM   #1
lipun4u
Member
 
Registered: Sep 2008
Location: Mumbai, india
Distribution: ubuntu and hp-unix
Posts: 118

Rep: Reputation: 15
shell script to remove tags


Can somebody give me a shell script which will remove all tags and scripts(java script/vb script code) from an HTML file ?

This might look like a homework question, but I am a c++ programmer and I need to bipass these things .
 
Old 12-05-2011, 12:52 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1960Reputation: 1960Reputation: 1960Reputation: 1960Reputation: 1960Reputation: 1960Reputation: 1960Reputation: 1960Reputation: 1960Reputation: 1960Reputation: 1960
There are several programs available that will convert html to plain text; html2text and unhtml are two that I know of. There are doubtless many more out there on the web.

If this doesn't satisfy your requirements then you'll have to be more specific about what you want to do.
 
Old 12-05-2011, 02:19 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,094

Rep: Reputation: 4380Reputation: 4380Reputation: 4380Reputation: 4380Reputation: 4380Reputation: 4380Reputation: 4380Reputation: 4380Reputation: 4380Reputation: 4380Reputation: 4380
Quote:
Originally Posted by lipun4u View Post
Can somebody give me a shell script which will remove all tags and scripts(java script/vb script code) from an HTML file ?

This might look like a homework question, but I am a c++ programmer and I need to bipass these things .
Sorry, but this isn't the place to come to get scripts written for you. If you want to hire someone to write a script, post in the LQ Job Marketplace, and tell us how much you'll pay.

Otherwise, provide sample input and output data, and what you've written/done so far, and where you're stuck, and we can try to help. If you're a C++ programmer, you should know these things are needed to get any help with code writing. Also, based on your posting history, you've done lots with bash scripting in the past...this should be trivial for you to do.

Last edited by TB0ne; 12-05-2011 at 02:22 PM.
 
Old 12-05-2011, 03:07 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,698

Rep: Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291
'html2text' : I would usually prefer "the other one" : html2txt

http://www.linuxquestions.org/questi...6&d=1292610942
 
  


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
Remove a script from all files - Shell script moyorakkhi Programming 2 02-22-2011 09:09 AM
[SOLVED] sed does not remove word done from within shell script dnoob Programming 8 02-11-2011 03:51 PM
Shell script to remove backup ~ files hallamigo Linux - General 3 09-13-2010 03:47 PM
shell script - remove line siegi82 Linux - Software 7 07-20-2010 07:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:36 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