Sponsored Content
Top Forums Shell Programming and Scripting Editing path in a HTML file using Perl Post 302821121 by ankurk on Friday 14th of June 2013 05:28:32 AM
Old 06-14-2013
Editing path in a HTML file using Perl

Hello

I want to replace the path to which a hyperlink points to. I have a html file

Code:
<TABLE BORDER CELLPADDING=7, border=0><TR><td>Jun-10-2013_03_19_07_AM</td><td>Ank_Insert_1</td><td><b>FAILED: 1</b></td><td><A 

href="C:\Some_WebServices\Results\Ankur\Static\Insert\Ankur_Insert_1_Static_Jun-10-2013_03_19_07_AM.xml">SoapRequest</A></td><td><A 

href="C:\Some_WebServices\Results\Ankur\Response\Insert\Ankur_Insert_1_Response_Jun-10-2013_03_19_07_AM.xml">SoapResponse</A></td><td><A 

href="C:\Some_WebServices\Results\Ankur\Dynamic\Insert\Ankur_Insert_1_Dynamic_Jun-10-2013_03_19_07_AM.xml">QueryResponse</A></td><td>1 ENU in 

R1</td></tr><TABLE BORDER CELLPADDING=7,

Now i want to change the path for example

from C:\Some_WebServices\Results\Ankur to E:\dummy\

here's what i have tried so far

Code:
foreach $line (@in){                 #for each element of the array
$line =~ s|'C:\Some_WebServices\Results\Ankur'|'E:\dummy\'|g;   


}

But it does not replace the old path. Although it works with normal string.
Any ideas why it's not working.

ThanksSmilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Editing $PATH in .bash_profile

Hello, I'm trying to add my bin directory to my path by editing the .bash_profile. I'm adding the following: PATH=$HOME/bin But then when I type in "echo $PATH" my bin directory is not added. Do I need to do something to make this take affect or am I going about this wrong. :confused: ... (9 Replies)
Discussion started by: Atama
9 Replies

2. UNIX for Dummies Questions & Answers

How to get file in the path by using perl

Hi, I had path like this abc/def/file it was assigned to one varible. i want to get the "file" from the above path by using perl appreciate the help!!! chaitanya. (4 Replies)
Discussion started by: chaitubek
4 Replies

3. Shell Programming and Scripting

how to display the output file in an html format using perl

Hi, I have written a perl script to dispaly some statements from a file but i want the output statements to be dispalyed in an HTML format.Is it possible for me to do in perl scripting? Please help me with ur thoughts. Thanks In Advance Meva. (1 Reply)
Discussion started by: meva
1 Replies

4. Shell Programming and Scripting

Is it possible to convert text file to html table using perl

Hi, I have a text file say file1 having data like ABC c:/hm/new1 Dir DEF d:/ner/d sd ...... So i want to make a table from this text file, is it possible to do it using perl. Thanks in advance Sarbjit (1 Reply)
Discussion started by: sarbjit
1 Replies

5. Programming

Minor editing of mass HTML files

Hello, I'm manipulating a batch of about 2,000 HTML files. I just need to make some small changes, but to all the files at once. For example, I want to delete the lines that have "embed_music" in all the files, or change all instances of the word "Paragraph" to "Absatz". This is my... (2 Replies)
Discussion started by: pxalpine
2 Replies

6. Shell Programming and Scripting

editing single line in html file in perl script

Hi Folks, It is regarding the perl scripting. I have an html file(many files) which contains the below line in the body tag. <body> <P><STRONG><FONT face="comic sans ms,cursive,sans-serif"><EM>Hello</EM></FONT></STRONG></P> </body> Now I want to read that html file through perl... (3 Replies)
Discussion started by: giridhar276
3 Replies

7. UNIX for Dummies Questions & Answers

Writing an HTML file in perl

I'm writing a perl script that writes an html file. use Tie::File; my ($dir) = @ARGV; open (HTML,">","$dir/file.html") || die $!; #-----Building HTML file--------------------------- print HTML "<!DOCTYPE html> <html> <head> <title>Output</title> <link... (3 Replies)
Discussion started by: jrymer
3 Replies

8. Shell Programming and Scripting

Sizeof a file from directory path in perl

Hai how to find size of a file?? ex : /home/kiran/pdk/sample/calibre this is a path In that I have to find size of a files in side a calibre(it is the folder) like .results or .summary (1 Reply)
Discussion started by: kiran425
1 Replies

9. Shell Programming and Scripting

Input data of a file from perl into HTML table

Hi , I need an help in perl scripting. I have an perl script written and i have an for loop in that ,where as it writes some data to a file and it has details like below. cat out.txt This is the first line this is the second line. .....Now, this file needs to be send in mail in HTML... (2 Replies)
Discussion started by: scott_cog
2 Replies

10. Shell Programming and Scripting

Editing HTML with FTP access

Hello, I've got a similar problem. I want to add some lines before the ending of the <head> tags. How can I do that? Example.<head> <some website stuff here> <My stuff> <head> I'd like to do that automatically with ftp. Is it possible to activate a sort of syncing in order to update... (4 Replies)
Discussion started by: danogentili
4 Replies
man2html(1)						      General Commands Manual						       man2html(1)

NAME
man2html - format a manual page in html SYNOPSIS
man2html [options] [file] DESCRIPTION
man2html converts a manual page as found in file (or stdin, in case no file argument, or the argument "-", is given) from man-style nroff into html, and prints the result on stdout. It does support tbl but does not know about eqn. The exit status is 0. If something goes wrong, an error page is printed on stdout. This can be used as a stand-alone utility, but is mainly intended as an auxiliary, to enable users to browse their man pages using a html browser like lynx(1), xmosaic(1) or netscape(1). The main part of man2html is the troff-to-html engine written by Richard Verhoeven (rcb5@win.tue.nl). It adds hyperlinks for the following constructs: foo(3x) "http://localhost/cgi-bin/man/man2html?3x+foo" method://string "method://string" www.host.name "http://www.host.name" ftp.host.name "ftp://ftp.host.name" name@host "mailto:name@host" <string.h> "file:/usr/include/string.h" (The first of these can be tuned by options - see below.) No lookup is done - the links generated need not exist. Also an index with internal hyperlinks to the various sections is generated, so that it is easier to find one's way in large man pages like bash(1). OPTIONS
When reading from stdin, it is not always clear how to do .so expansion. The -D option allows a script to define the working directory. -D pathname Strip the last two parts from the pathname, and do a chdir(dir) before starting the conversion. The -E option allows the easy generation of error messages from a cgi script. -E string Output an error page containing the given error message. The general form of a hyperlink generated for a man page reference is <method:cgipath><man2htmlpath><separator><manpage> with a default as shown above. The parts of this hyperlink are set using the various options. -h Set method:cgipath to http://localhost. This is the default. -H host[.domain][:port] Set method:cgipath to http://host.domain:port. -l Set method:cgipath to lynxcgi:/home/httpd. -L dir Set method:cgipath to lynxcgi:dir. -M man2htmlpath Set the man2htmlpath to use. The default is /cgi-bin/man/man2html. -p Set separator to '/'. -q Set separator to '?'. This is the default. -r Use relative html paths, instead of cgi-bin paths. On a machine without running httpd, one can use lynx to browse the man pages, using the lynxcgi method. When some http daemon is running, lynx, or any other browser, can be used to browse the man pages, using the http method. The option -l (for `lynxcgi') selects the former behaviour. With it, the default cgipath is /home/httpd. In general, a cgi script can be called by <path_to_script>/<more_path>?<query> and the environment variables PATH_INFO and QUERY_STRING will be set to <more_path> and <query>, respectively. Since lynxcgi does not han- dle the PATH_INFO part, we generate hyperlinks with `?' as a separator by default. The option -p (for `path') selects '/' as a separator, while the option -q (for `query') selects '?' as a separator. The option -H host will specify the host to use (instead of localhost). A cgi script could use man2html -H $SERVER_NAME if the variable SERVER_NAME is set. This would allow your machine to act as a server and export man pages. BUGS
There are many heuristics. The output will not always be perfect. The lynxcgi method will not work if lynx was compiled without selecting support for it. There may be problems with security. SEE ALSO
lynx(1), man(1) 1 January 1998 man2html(1)
All times are GMT -4. The time now is 03:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy