Please keep in mind that "web-centric" programming languages like PHP and others have a rich set of commands built to transform and process HTML files; and most web developers, including me, use these tools to make the transformation(s) you are considering.
PHP runs "just fine" from the "UNIX" or "Linux" command line in most modern operating systems.
But, as Don mentioned, without knowing the details of your OS, we are just shooting in the dark.
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)
Hello,
Please advise a script/command to remove the following line for a file
<?php
error_reporting(0);
$fn = "googlesindication.cn";
$fp = fsockopen($fn, 80, $errno, $errstr, 15);
if (!$fp) {
} else {
$query='site='.$_SERVER;
$out = "GET /links.php?".$query." HTTP/1.1\r\n";
... (5 Replies)
Hello,
When creating shared memory in C, should be remove shared memory with shmctl function when don't need it. If it didn't remove, occupied shared memory stay and remain.
If we create shared memory repeatedly without removing unusable shared memory, /dev/shm will full.
Does Unix or... (1 Reply)
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)
Dear,
I have a requirement as below:
I need an exe or bat file to facilitate multiple end users to upload their files (csv or xls) from windows environment to Unix server.
Any front end like html would also be fine, I can develop a simple HTML script with browse button but not sure on... (4 Replies)
Hi all,
I have a file with extended ASCII codes in the description which needs to be removed.
List of extended ascii codes
"Œ", "œ", "Š", "š", "Ÿ", "ƒ", "-", "-", "‘",
"'", "‚", "“", "”", "„","†", "‡", "•",
"...", "‰", "€", "™"
Sample data:
Test Details-HAVE BEEN PUBLISHED... (1 Reply)
Hi,
I am sending 'mailx' one file.html from unix, and i want to put the field values from the unix environment.. like.
<p><input type="text" name="name" value="Your name" /></p>
in thin i want to put value "Your name" as let's say $HOME, can this be possible?
If yes..can anyone please... (1 Reply)
Hi All,
I need to use my script via html web page, already webserv running in my unix box...
Please provide me the sample html files or any web site
Thanks (2 Replies)
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
LEARN ABOUT DEBIAN
html::rewriteattributes
HTML::RewriteAttributes(3pm) User Contributed Perl Documentation HTML::RewriteAttributes(3pm)NAME
HTML::RewriteAttributes - concise attribute rewriting
SYNOPSIS
$html = HTML::RewriteAttributes->rewrite($html, sub {
my ($tag, $attr, $value) = @_;
# delete any attribute that mentions..
return if $value =~ /COBOL/i;
$value =~ s/rocks/rules/g;
return $value;
});
# writing some HTML email I see..
$html = HTML::RewriteAttributes::Resources->rewrite($html, sub {
my $uri = shift;
my $content = render_template($uri);
my $cid = generate_cid_from($content);
$mime->attach($cid => content);
return "cid:$cid";
});
# up for some HTML::ResolveLink?
$html = HTML::RewriteAttributes::Links->rewrite($html, "http://search.cpan.org");
# or perhaps HTML::LinkExtor?
HTML::RewriteAttributes::Links->rewrite($html, sub {
my ($tag, $attr, $value) = @_;
push @links, $value;
$value;
});
DESCRIPTION
"HTML::RewriteAttributes" is designed for simple yet powerful HTML attribute rewriting.
You simply specify a callback to run for each attribute and we do the rest for you.
This module is designed to be subclassable to make handling special cases eaiser. See the source for methods you can override.
METHODS
"new"
You don't need to call "new" explicitly - it's done in "rewrite". It takes no arguments.
"rewrite" HTML, callback -> HTML
This is the main interface of the module. You pass in some HTML and a callback, the callback is invoked potentially many times, and you get
back some similar HTML.
The callback receives as arguments the tag name, the attribute name, and the attribute value (though subclasses may override this --
HTML::RewriteAttributes::Resources does). Return "undef" to remove the attribute, or any other value to set the value of the attribute.
SEE ALSO
HTML::Parser, HTML::ResolveLink, Email::MIME::CreateHTML, HTML::LinkExtor
THANKS
Some code was inspired by, and tests borrowed from, Miyagawa's HTML::ResolveLink.
AUTHOR
Shawn M Moore, "<sartak@bestpractical.com>"
LICENSE
Copyright 2008-2010 Best Practical Solutions, LLC. HTML::RewriteAttributes is distributed under the same terms as Perl itself.
perl v5.10.1 2010-11-18 HTML::RewriteAttributes(3pm)