Maybe your problem is in the actual HTML? If you're using the results straight from sed, you're probably getting something like this:
And if that's the case, you're missing the <br /> tag that signals a line break in HTML. If I remember correctly, implicit line breaks like the ones above turn into spaces when HTML is rendered on to a webpage.
So, if this is your problem, try replacing the spaces with "<br />" instead of newlines.
Last edited by j_jiffer; 07-14-2010 at 05:58 PM..
Reason: typo
Hi
I need to know how I change the spaces by _ in folders and filder founded by find
ex.
find . -name "* *" -exec echo {} \;
./test space
./test space/new file.txt
./test space/new file
./test space/untitled folder
./test space/untitled folder/new fileruben
./Backup/backup/Image... (6 Replies)
Hai masters,
If a file contains content of 2000 lines,
from which i need to remove the first n characters or first n spaces from each line of the file.
If suppose to remove n characters or first n spaces from a single line means, just use the command nx.
But from the above scenario,... (9 Replies)
I'm trying to learn how to get my script to execute the enter button when it telnets into a router and the router displays output but you need to press the space bar or enter button to continue displaying my output of the router.
How is this done? (0 Replies)
hi,
d o g e v o l
i want a perl command for the above string which should change to the below
dog evol
replace one space with nothing and two spaces with one space.
Thanks,
Amey (3 Replies)
Hi,
I need torename filenames with %20 to space in a batch wise.Can anyone help me please. Need it badly
Eg.
English%20Brochure%20002-1
to be replace to
English Brochure 002-1
Thanks a lot
Please use and tags when posting code, data or logs etc. to preserve formatting... (8 Replies)
HI
i have written a script to ask input from the user.
this script should promote the user for y/n input. if user enters anyother input then y/n
the script promotes him again. this below code is working fine for all the cases.
except for space and enter " if i give space and enter it is... (2 Replies)
How to change the uploaded weekly file data to the following format?
New Well_Id,Old Well_Id,District,Thana,Date,Data,R.L,WellType,Lati.,Longi.
BAG001,PT006,BARGUNA,AMTALI,1/2/1978,1.81,2.29,Piezometer,220825,901430
BAG001,PT006,BARGUNA,AMTALI,1/9/1978,1.87,2.29,Piezometer,220825,901430... (3 Replies)
have three big data file, however I just need to see the mentioned below one line form the all the file which has SERVER_CONNECTION Value
File 1
export SERVER_CONNECTION=//dvlna002:10001/SmartServer
File2
export SERVER_CONNECTION=///SmartServer
File3
export... (1 Reply)
Discussion started by: Nsharma3006
1 Replies
LEARN ABOUT DEBIAN
html::strip
Strip(3pm) User Contributed Perl Documentation Strip(3pm)NAME
HTML::Strip - Perl extension for stripping HTML markup from text.
SYNOPSIS
use HTML::Strip;
my $hs = HTML::Strip->new();
my $clean_text = $hs->parse( $raw_html );
$hs->eof;
DESCRIPTION
This module simply strips HTML-like markup from text in a very quick and brutal manner. It could quite easily be used to strip XML or SGML
from text as well; but removing HTML markup is a much more common problem, hence this module lives in the HTML:: namespace.
It is written in XS, and thus about five times quicker than using regular expressions for the same task.
It does not do any syntax checking (if you want that, use HTML::Parser), instead it merely applies the following rules:
1. Anything that looks like a tag, or group of tags will be replaced with a single space character. Tags are considered to be anything
that starts with a "<" and ends with a ">"; with the caveat that a ">" character may appear in either of the following without ending
the tag:
Quote
Quotes are considered to start with either a "'" or a """ character, and end with a matching character not preceded by an even
number or escaping slashes (i.e. """ does not end the quote but "\\"" does).
Comment
If the tag starts with an exclamation mark, it is assumed to be a declaration or a comment. Within such tags, ">" characters do not
end the tag if they appear within pairs of double dashes (e.g. "<!-- <a href="old.htm">old page</a> -->" would be stripped
completely).
2. Anything the appears within so-called strip tags is stripped as well. By default, these tags are "title", "script", "style" and
"applet".
HTML::Strip maintains state between calls, so you can parse a document in chunks should you wish. If one chunk ends half-way through a tag,
quote, comment, or whatever; it will remember this, and expect the next call to parse to start with the remains of said tag.
If this is not going to be the case, be sure to call $hs->eof() between calls to $hs->parse().
METHODS
new()
Constructor. Can optionally take a hash of settings (with keys corresponsing to the "set_" methods below).
For example, the following is a valid constructor:
my $hs = HTML::Strip->new(
striptags => [ 'script', 'iframe' ],
emit_spaces => 0
);
parse()
Takes a string as an argument, returns it stripped of HTML.
eof()
Resets the current state information, ready to parse a new block of HTML.
clear_striptags()
Clears the current set of strip tags.
add_striptag()
Adds the string passed as an argument to the current set of strip tags.
set_striptags()
Takes a reference to an array of strings, which replace the current set of strip tags.
set_emit_spaces()
Takes a boolean value. If set to false, HTML::Strip will not attempt any conversion of tags into spaces. Set to true by default.
set_decode_entities()
Takes a boolean value. If set to false, HTML::Strip will decode HTML entities. Set to true by default.
LIMITATIONS
Whitespace
Despite only outputting one space character per group of tags, and avoiding doing so when tags are bordered by spaces or the start or
end of strings, HTML::Strip can often output more than desired; such as with the following HTML:
<h1> HTML::Strip </h1> <p> <em> <strong> fast, and brutal </strong> </em> </p>
Which gives the following output:
" HTML::Strip fast, and brutal "
Thus, you may want to post-filter the output of HTML::Strip to remove excess whitespace (for example, using "tr/ / /s;"). (This has
been improved since previous releases, but is still an issue)
HTML Entities
HTML::Strip will only attempt decoding of HTML entities if HTML::Entities is installed.
EXPORT
None by default.
AUTHOR
Alex Bowley <kilinrax@cpan.org>
SEE ALSO
perl, HTML::Parser, HTML::Entities
perl v5.14.2 2011-11-15 Strip(3pm)