Sponsored Content
Full Discussion: Remove html tags with bash
Top Forums Shell Programming and Scripting Remove html tags with bash Post 302198283 by Franklin52 on Thursday 22nd of May 2008 01:36:16 PM
Old 05-22-2008
You can't redirect the output to the inputfile. Redirect the output to a temporary file and move it to the original file, something like this:

Code:
awk '/<\/body>/ || /<\/html>/{next}1' file.html > file1.html

mv file1.html file.html

Regards
This User Gave Thanks to Franklin52 For This Post:
 

10 More Discussions You Might Find Interesting

1. Linux

How to remove only html tags inside a file?

Hi All, I have following example file i want to remove all html tags only, Input File: <html> <head> <title>Software Solutions Inc., </title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor=white leftmargin="0" topmargin="0"... (2 Replies)
Discussion started by: btech_raju
2 Replies

2. Shell Programming and Scripting

How to use sed to remove html tags including text between them

How to use sed to remove html tags including text between them? Example: User <b> rolvak </b> is stupid. It does not using <b>OOP</b>! and should output: User is stupid. It does not using ! Thank you.. (2 Replies)
Discussion started by: alphagon
2 Replies

3. Shell Programming and Scripting

HTML code remove

Hello, I have one file which has been inserted intermittently with HTML web page. I would like to remove all text between "<html xmlns="http://www.w3.org/1999/xhtml">" and </html> tags. Can any one please suggest me sed regular expression for it. Thanks (3 Replies)
Discussion started by: nrbhole
3 Replies

4. Shell Programming and Scripting

remove html tags,consecutive duplicate lines

I need help with a script that will remove all HTML tags from an HTML document and remove any consecutive duplicate lines, and save it as a text document. The user should have the option of including the name of an html file as an argument for the script, but if none is provided, then the script... (7 Replies)
Discussion started by: clicstic
7 Replies

5. Shell Programming and Scripting

BASH parsing for html tags

Hello can anyone help me parse this line. <tr><td>United States of America</td><td>Dollar</td><td>43.309</td></tr><tr><td>Japan</td><td>Yen</td><td>0.5579</td></tr> the line above did not break. so i would like to have a result like this United States of America Dollar 43.309 Japan... (3 Replies)
Discussion started by: doomsayer16
3 Replies

6. Shell Programming and Scripting

Parsing HTML, get text between 2 HTML tags

Hi there, I'm quite new to the forum and shell scripting. I want to filter out the "166.0 points". The results, that i found in google / the forum search didn't helped me :( <a href="/user/test" class="headitem menu" style="color:rgb(83,186,224);">test</a><a href="/points" class="headitem... (1 Reply)
Discussion started by: Mysthik
1 Replies

7. Shell Programming and Scripting

Remove html tags with particular string inside the tags

Could someone, please provide a solution to the following: I would like to remove some tags from the "head" of multiple html documents across the web site. They look like <link rel="alternate" type="application/rss+xml" title="Business and Investment in the Philippines"... (2 Replies)
Discussion started by: georgi58
2 Replies

8. Shell Programming and Scripting

Removing all except couple of html tags from html file

I tried to find elegant (or at least simple) way to remove all but couple of html tags from html file, but all examples I found dealt with removing all the tags. The logic of the script would be: - if there is <li> or <ul> on the line, do nothing (=write same line to output) - if there is:... (0 Replies)
Discussion started by: juubuntu
0 Replies

9. Shell Programming and Scripting

How to remove the values inside the html tags?

Hi, I have a txt file which contain this: <a href="linux">Linux</a> <a href="unix">Unix</a> <a href="oracle">Oracle</a> <a href="perl">Perl</a> I'm trying to extract the text in between these anchor tag and ignoring everything else using grep. I managed to ignore the tags but unable to... (6 Replies)
Discussion started by: KCApple
6 Replies

10. Shell Programming and Scripting

How to remove multiline HTML tags from a file?

I am trying to remove a multiline HTML tag and its contents from a few HTML files following the same basic pattern. So far using regex and sed have been unsuccessful. The HTML has a basic structure like this (with the normal HTML stuff around it): <div id="div1"> <div class="div2"> <other... (4 Replies)
Discussion started by: threesixtyfive
4 Replies
TEXVC(1)							  [FIXME: manual]							  TEXVC(1)

NAME
texvc - math equation PNG renderer SYNOPSIS
texvc {tempdir} {outputdir} {texcode} {encoding} DESCRIPTION
texvc is designed to render math equations written in latex code into PNG images. OPTIONS
{tempdir} directory where temporary files are created. {outputdir} directory where the result image is stored. {texcode} latex code string representing math equations. {encoding} used encoding in latex code string. OUTPUT
Status codes and HTML/MathML transformations are returned on stdout. A rasterized PNG file will be written to the output directory, named for the MD5 hash code. texvc output format is like this: o +%5 ok, but not html or mathml o c%5%h ok, conservative html, no mathml o m%5%h ok, moderate html, no mathml o l%5%h ok, liberal html, no mathml o C%5%h%m ok, conservative html, with mathml o M%5%h%m ok, moderate html, with mathml o L%5%h%m ok, liberal html, with mathml o X%5%m ok, no html, with mathml o S syntax error o E lexing error o F%s unknown function %s o - other error with the following codes: o - null character o %5 - md5, 32 hex characters o %h - html code, without characters o %m - mathml code, without characters AUTHOR
This manual page was written by Marc Dequ[`e]nes (Duck) Duck@DuckCorp.org for the Debian(TM) system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. AUTHOR
Marc Dequ[`e]nes Author. COPYRIGHT
Copyright (C) 2003 Marc Dequenes (Duck) [FIXME: source] 2005-01-02 TEXVC(1)
All times are GMT -4. The time now is 10:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy