Sponsored Content
Operating Systems Linux How to remove only html tags inside a file? Post 302147005 by btech_raju on Friday 23rd of November 2007 10:36:24 AM
Old 11-23-2007
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" marginwidth="00" marginheight="0" class=NormalFont>
<table ID="Table2" Bordercolor=black border=2 cellspacing=2 cellpadding=2>
<TR><TD colspan=4 align=left bgcolor="yellow"><font color=blue ><b> Iswar Ramamoorthy</b></font></TD> </TR>
<tr>
<td align=center><b>Date</b></td>
<td align=center><b>Total Hours</b></td>
<td align=center><b>Total IN Time</b></td>
<td align=center><b>Total Break Hours</b></td>
</tr>


</table>


<table ID="Table2" Bordercolor=black border=2 cellspacing=2 cellpadding=2>
<TR><TD colspan=4 align=left bgcolor="yellow"><font color=blue ><b>Aman Jain</b></font></TD> </TR>
<tr>
<td align=center><b>Date</b></td>
<td align=center><b>Total Hours</b></td>
<td align=center><b>Total IN Time</b></td>
<td align=center><b>Total Break Hours</b></td>
</tr>


</table>


<table ID="Table2" Bordercolor=black border=2 cellspacing=2 cellpadding=2>
<TR><TD colspan=4 align=left bgcolor="yellow"><font color=blue ><b>Anilkumar Kaandukuri</b></font></TD> </TR>
<tr>
<td align=center><b>Date</b></td>
<td align=center><b>Total Hours</b></td>
<td align=center><b>Total IN Time</b></td>
<td align=center><b>Total Break Hours</b></td>
</tr>


<tr class=normalfont >
<td align=center>11/16/2007</td>
<td align=center>1:16:0</td>
<td align=center>01:16</td>
<td align=center>0</td>
</tr>

</table>


<table ID="Table2" Bordercolor=black border=2 cellspacing=2 cellpadding=2>
<TR><TD colspan=4 align=left bgcolor="yellow"><font color=blue ><b>Arun Sivaraman</b></font></TD> </TR>
<tr>
<td align=center><b>Date</b></td>
<td align=center><b>Total Hours</b></td>
<td align=center><b>Total IN Time</b></td>
<td align=center><b>Total Break Hours</b></td>
</tr>

My expected result:

Software Solutions Inc

Iswar Ramamoorthy

Date
Total Hours
Total IN Time
Total Break Hours

Aman Jain

Date
Total Hours
Total IN Time
Total Break Hours

Anilkumar Kaandukuri

Date
Total Hours
Total IN Time
Total Break Hours

11/16/2007
1:16:0
01:16
0

............
...........

etc............
btech_raju
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove html tags with bash

Hello, is there a way to go through a file and remove certain html tags with bash? If it needs sed or awk, that'll do too. The reason why I want this is, because I have a monitor script which generates a logfile in HTML and every time it generates a logfile, the tags are reproduced. The tags... (4 Replies)
Discussion started by: dejavu88
4 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

To remove file using rm inside c

Unixians, I need one help,I have to remove a file from particular path. see my code snippet, { char cmd=""; sprintf (cmd, "/bin/rm -f %s%s%s%s","/usr1/mydir/", 1.t,2.t,3.t); system(cmd); } The problem is it read as a "/usr1/mydir/1.t2.t3.t" and no files is removed. Can u plz... (7 Replies)
Discussion started by: kkl
7 Replies

4. Shell Programming and Scripting

Remove external urls from .html file

Hi everyone. I have an html file with lines like so: link href="localFolder/..."> link href="htp://..."> img src="localFolder/..."> img src="htp://..."> I want to remove the links with http in the href and imgs with http in its src. I'm having trouble removing them because there... (4 Replies)
Discussion started by: CowCow339
4 Replies

5. 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

6. Shell Programming and Scripting

How to remove string inside html tag <a>

Does anybody know how i can remove string from <a> tag? There are several hundred posts in a few forums that need to be cleaned up. The precise situation is ---------- <a href="http://mydomain.com/cgi-bin/anyboard.cgi?fvp=/family/sexuality_and_spirituality/&cmd=rA&cG=43"> ------------- my... (6 Replies)
Discussion started by: georgi58
6 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
RFIO_STATFS(3)						      Rfio Library Functions						    RFIO_STATFS(3)

NAME
rfio_statfs - get information about a mounted filesystem SYNOPSIS
#include <sys/types.h> #include "rfio_api.h" int rfio_statfs (const char *path, struct rfstatfs *statfsbuf); Under Linux, for large files: #define _LARGEFILE64_SOURCE #include <sys/types.h> #include "rfio_api.h" int rfio_statfs64 (const char *path, struct rfstatfs64 *statfsbuf); For large files, under other systems: #include <sys/types.h> #include "rfio_api.h" int rfio_statfs64 (const char *path, struct rfstatfs64 *statfsbuf); DESCRIPTION
rfio_statfs gets information about a mounted filesystem. path specifies the logical pathname relative to the current directory or the full pathname of any file in this filesystem. statfsbuf is a pointer to a rfstatfs structure: struct rfstatfs { long totblks ; /* Total number of blocks */ long freeblks ; /* Number of free blocks */ long bsize ; /* Block size */ long totnods ; /* Total number of inodes */ long freenods ; /* Number of free inodes */ }; struct rfstatfs64 { signed64 totblks ; /* Total number of blocks */ signed64 freeblks ; /* Number of free blocks */ long bsize ; /* Block size */ signed64 totnods ; /* Total number of inodes */ signed64 freenods ; /* Number of free inodes */ }; The 64 bits function must be used for large filesystems. It has the same syntax as the normal statfs function except that it uses a rfs- tatfs64 structure. RETURN VALUE
This routine returns 0 if the operation was successful or -1 if the operation failed. In the latter case, serrno is set appropriately. ERRORS
ENOENT The named file/directory does not exist or is a null pathname. EACCES Search permission is denied on a component of the path prefix. EFAULT path or statfsbuf is a NULL pointer. ENOTDIR A component of path prefix is not a directory. ENAMETOOLONG The length of path exceeds CA_MAXPATHLEN or the length of a path component exceeds CA_MAXNAMELEN. SENOSHOST Host unknown. SENOSSERV Service unknown. SECOMERR Communication error. SEE ALSO
Castor_limits(4) AUTHOR
LCG Grid Deployment Team LCG
$Date: 2005/09/20 12:07:09 $ RFIO_STATFS(3)
All times are GMT -4. The time now is 03:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy