Sponsored Content
Top Forums Shell Programming and Scripting How to remove urls from html files Post 302630981 by georgi58 on Thursday 26th of April 2012 02:46:09 PM
Old 04-26-2012
works great

thank you very much for your help.

your script works great.

appreciate your time and efforts.
 

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

Extract URLs from HTML code using sed

Hello, i try to extract urls from google-search-results, but i have problem with sed filtering of html-code. what i wont is just list of urls thay apears between ........<p><a href=" and next following " in html code. here is my code, i use wget and pipelines to filtering. wget works, but... (13 Replies)
Discussion started by: L0rd
13 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

Extract urls from index.html downloaded using wget

Hi, I need to basically get a list of all the tarballs located at uri I am currently doing a wget on urito get the index.html page Now this index page contains the list of uris that I want to use in my bash script. can someone please guide me ,. I am new to Linux and shell scripting. ... (5 Replies)
Discussion started by: mnanavati
5 Replies

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

6. Shell Programming and Scripting

Need script to remove millions of tmp files in /html/cache/ directory

Hello, I just saw that on my vps (centOS) my oscommerce with a seo script has created millions of tmp files inside the /html/cache/ directory. I would need to remove all those files (millions), I tried via shell but the vps loads goes to very high and it hangs, is there some way to do a... (7 Replies)
Discussion started by: andymc1
7 Replies

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

8. UNIX for Dummies Questions & Answers

Remove all HTML, scripts and styles?

Hi all, How might I go about writing a program that will read all input as an HTML file, and subsequently strip all HTML, embedded scripts and style sheets from its input, leaving only text as the output? I am a beginner, so the simpler, the better. Thanks for any advice :) (4 Replies)
Discussion started by: Molly.P.
4 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

Regex for URLs and files

Hi, I am looking for a regex that will validate a URL and files accessed in a browser. For example:http://www.google.co.uk http://www.google.com https://www.google.co.uk https://www.google.com ftp:// file:///somefile/on/a/server/accessed/from/browser/file.txt So far I have: ... (4 Replies)
Discussion started by: muay_tb
4 Replies
HTML::FromText(3pm)					User Contributed Perl Documentation				       HTML::FromText(3pm)

NAME
HTML::FromText - Convert plain text to HTML. SYNOPSIS
use HTML::FromText; text2html( $text, %options ); # or use HTML::FromText (); my $t2h = HTML::FromText->new( \%options ); my $html = $t2h->parse( $html ); DESCRIPTION
"HTML::FromText" converts plain text to HTML. There are a handfull of options that shape the conversion. There is a utility function, "text2html", that's exported by default. This function is simply a short- cut to the Object Oriented interface described in detail below. Methods The following methods may be used as the public interface. new my $t2h = HTML::FromText->new({ paras => 1, blockcode => 1, tables => 1, bullets => 1, numbers => 1, urls => 1, email => 1, bold => 1, underline => 1, }); Constructs a new "HTML::FromText" object using the given configuration. The resulting object can parse lots of objects using the "parse" method. Options to "new" are passed by name, with the value being either true or false. If true, the option will be turned on. If false, it will be turned off. The following outlines all the options. Decorators metachars This option is on by default. All characters that are unsafe for HTML display will be encoded using "HTML::Entities::encode_entities()". urls This option is off by default. Replaces URLs with links. email This option is off by default. Replaces email addresses with "mailto:" links. bold This option is off by default. Replaces text surrounded by asterisks ("*") with the same text surrounded by "strong" tags. underline This option is off by default. Replaces text surrownded by underscores ("_") with the same text surrounded by "span" tags with an underline style. Output Modes The following are three output modes and the options associated with them. They are listed in order of precidence. If none of these modes are supplied, the basic decorators are applied to the text in whole. pre This option is off by default. Wraps the entire text in "pre" tags. lines This option is off by default. Preserves line breaks by inserting "br" tags at the end of each line. This mode has further options. spaces This option is off by default. All spaces are HTML encoded. paras This option is off by default. Preserves paragraphs by wrapping them in "p" tags. This mode has further options. bullets This option is off by default. Convert bulleted lists into unordered lists ("ul"). Bullets can be either an asterisk ("*") or a hyphen ("-"). Lists can be nested. numbers This option is off by default. Convert numbered lists into ordered lists ("ol"). Numbered lists are identified by numerals. Lists may be nested. headings This option is off by default. Convert paragraphs identified as headings into HTML headings at the appropriate level. The heading "1. Top" would be heading level one ("h1"). The heading "2.5.1. Blah" would be heading level three ("h3"). title This option is off by default. Convert the first paragraph to a heading level one ("h1"). tables This option is off by default. Convert paragraphs identified as tables to HTML tables. Tables are two or more rows and two or more columns. Columns should be separated by two or more spaces. The following options apply specifically to indented paragraphs. They are listed in order of precidence. blockparas This option is off by default. Convert indented paragraphs to block quotes using the "blockquote" tag. blockquotes Convert indented paragraphs as "blockparas" would, but also preserving line breaks. blockcode Convert indented paragraphs as "blockquotes" would, but also preserving spaces using "pre" tags. parse my $html = $t2h->parse( $text ); Parses text supplied as a single scalar string and returns the HTML as a single scalar string. All the tabs in your text will be expanded using "Text::Tabs::expand()". Functions text2html my $html = text2html( $text, urls => 1, email => 1, ); Functional interface that just wraps the OO interface. This function is exported by default. If you don't want it you can "require" the module or "use" it with an empty list. require HTML::FromText; # or ... use HTML::FromText (); Subclassing Note: At the time of this release, the internals of "HTML::FromText" are in a state of development and cannot be expected to stay the same from release to release. I expect that release version 3.00 will be analogous to a 1.00 release of other software. This is because the cur- rent maintainer has rewritten this distribution from the ground up for the "2.x" series. You have been warned. The following methods may be used for subclassing "HTML::FromText" to create your own text to HTML conversions. Each of these methods is passed just one argument, the object ($self), unless otherwise stated. The structure of $self is as follows for this release. { options => { option_name => $value, ... }, text => $text, # as passed to parse(), with tabs expanded html => $html, # the HTML that will be returned from parse() } pre Used when "pre" mode is specified. Should set "$self->{html}". Return value is ignored. lines Used when "lines" mode is specified. Implements the "spaces" option internally when the option is set to a true value. Should set "$self->{html}". Return value is ignored. paras Used when the "paras" mode is specified. Splits "$self->{text}" into paragraphs internally and sets up "$self->{paras}" as follows. paras => { 0 => { text => $text, # paragraph text html => $html, # paragraph html }, ... # and so on for all paragraphs }, Implements the "title" option internally when the option is turned on. Converts any normal paragraphs to HTML paragraphs (surrounded by "p" tags) internally. Should set "$self->{html}". Return value is ignored. headings Used to format headings when the "headings" option is turned on. Return value is ignored. bullets Format bulleted lists when the "bullets" option is turned on. Return value is ignored. numbers Format numbered lists when the "numbers" option is turned on. Return value is ignored. tables Format tables when the "tables" option is turned on. Return value is ignored. blockparas Used when the "blockparas" option is turned on. Return value is ignored. blockquotes Used when the "blockquotes" option is turned on. Return value is ignored. blockcode Used when the "blockcode" option is turned on. Return value is ignored. urls Turn urls into links when "urls" option is turned on. Should operate on "$self->{html}". Return value is ignored. email Turn email addresses into "mailto:" links when "email" option is turned on. Should operate on "$self->{html}". Return value is ignored. underline Underline things between _underscores_ when "underline" option is turned on. Should operate on "$self->{html}". Return value is ignored. bold Bold things between *asterisks* when "bold" option is turned on. Should operate on "$self->{html}". Return value is ignored. metachars Encode meta characters when "metachars" option is turned on. Should operate on "$self->{html}". Return value is ignored. Output The output from "HTML::FromText" has been updated to pass XHTML 1.1 validation. Every HTML tag that should have a CSS class name does. They are prefixed with "hft-" and correspond to the names of the options to "new()" (or "text2html()"). For example "hft-lines", "hft-paras", and "hft-urls". One important note is the output for "underline". Because the <u> tag is deprecated in this specification a "span" is used with a style attribute of "text-decoration: underline". The class is "hft- underline". If you want to override the "text-decoration" style in the CSS class you'll need to do so like this. text-decoration: none !important; SEE ALSO
text2html(1). AUTHOR
Casey West <casey@geeknest.com>. AUTHOR EMERITUS
Gareth Rees <garethr@cre.canon.co.uk>. COPYRIGHT
Copyright (c) 2003 Casey West. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.8.8 2003-10-14 HTML::FromText(3pm)
All times are GMT -4. The time now is 06:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy