First...
Please note that learning to correctly use CODE tags is not that difficult..
Use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags [code] and [/code] by hand.) The following tutorial demonstrates how to do this.
And then...
What operating system and shell are you using?
What have you tried to solve this problem on your own?
Where are you stuck?
Do the devices in your output have to be sorted, or can the output be in the same order as your input?
This User Gave Thanks to Don Cragun For This Post:
I have a schell script that runs continously on an AIX system. It is actually started from another shell script with the "ksh -x" command and then I just write the output to a log file. This causes the log files to be filled with mostly useless information. I would like to modify this script to... (2 Replies)
am relatively new to Shell scripting.
I have written a script for parsing a big file. The logic is:
Apart from lot of other useless stuffs, there are many occurances of <abc> and corresponding </abc> tags. (All of them are properly closed)
My requirement is to find a particular tag (say... (3 Replies)
I have a large log file, which I want to first use grep to get the specific lines then send it to awk to print out the specific column and if the result is zero, don't do anything. What I have so far is:
LOGDIR=/usr/local/oracle/Transcription/log
ERRDIR=/home/edixftp/errors
#I want to be... (3 Replies)
Hi Experts,
Im a new bee for scripting,
I would ned to do the following via linux shell scripting, I have an application which throws a log file, on each action of a particular work with the application, as sson as the action is done, the log file would vanish or stops updating there, the... (2 Replies)
Hey guys,
I have this file generated by me... i want to create some HTML output from it.
The problem is that i am really confused about how do I go about reading the file.
The file is in the following format:
TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy... (8 Replies)
Hi Gurus,
I need your help in transforming the CSV file into some what a report format.
My source file looks like below
Date,ProdID,TimeID,LevelID
2010-08-31,200,M,1
2010-08-31,201,Q,2
2010-08-31,202,Y,1
2010-08-31,203,M,5
Output required is
... (9 Replies)
Working on a script that inputs an IP, parses and outputs to another file.
A Sample of the log is as follows:
I need the script to be able to input IP and print the data in an output file in the following format or something similar:
Thanks for any help you can give me! (8 Replies)
I have url string as follows and I need to parse the name value pair into fields /rows
event_id date time payload
1329130951 20120214 22.30.40... (1 Reply)
Hi ,
I am trying to create shell script which will help me to compare file name in two folder.
There is a multiple file store in 2 folder.I want to compare that with the name.
If all the file are same then send a mail that "all date is same"
if not then create one log file which contain... (4 Replies)
Hello All,
I am trying to parse a log file and i got this code from one of the good forum colleagues, However i realised later there is a problem with this awk script, being naive to awk world wanted to see if you guys can help me out.
AWK script:
awk '$1 ~ "^WRITER_" {p=1;next}... (18 Replies)
Discussion started by: Ariean
18 Replies
LEARN ABOUT DEBIAN
cgi::pretty
CGI::Pretty(3pm) User Contributed Perl Documentation CGI::Pretty(3pm)NAME
CGI::Pretty - module to produce nicely formatted HTML code
SYNOPSIS
use CGI::Pretty qw( :html3 );
# Print a table with a single data element
print table( TR( td( "foo" ) ) );
DESCRIPTION
CGI::Pretty is a module that derives from CGI. It's sole function is to allow users of CGI to output nicely formatted HTML code.
When using the CGI module, the following code:
print table( TR( td( "foo" ) ) );
produces the following output:
<TABLE><TR><TD>foo</TD></TR></TABLE>
If a user were to create a table consisting of many rows and many columns, the resultant HTML code would be quite difficult to read since
it has no carriage returns or indentation.
CGI::Pretty fixes this problem. What it does is add a carriage return and indentation to the HTML code so that one can easily read it.
print table( TR( td( "foo" ) ) );
now produces the following output:
<TABLE>
<TR>
<TD>foo</TD>
</TR>
</TABLE>
Recommendation for when to use CGI::Pretty
CGI::Pretty is far slower than using CGI.pm directly. A benchmark showed that it could be about 10 times slower. Adding newlines and spaces
may alter the rendered appearance of HTML. Also, the extra newlines and spaces also make the file size larger, making the files take longer
to download.
With all those considerations, it is recommended that CGI::Pretty be used primarily for debugging.
Tags that won't be formatted
The following tags are not formatted: <a>, <pre>, <code>, <script>, <textarea>, and <td>. If these tags were formatted, the user would see
the extra indentation on the web browser causing the page to look different than what would be expected. If you wish to add more tags to
the list of tags that are not to be touched, push them onto the @AS_IS array:
push @CGI::Pretty::AS_IS,qw(XMP);
Customizing the Indenting
If you wish to have your own personal style of indenting, you can change the $INDENT variable:
$CGI::Pretty::INDENT = " ";
would cause the indents to be two tabs.
Similarly, if you wish to have more space between lines, you may change the $LINEBREAK variable:
$CGI::Pretty::LINEBREAK = "
";
would create two carriage returns between lines.
If you decide you want to use the regular CGI indenting, you can easily do the following:
$CGI::Pretty::INDENT = $CGI::Pretty::LINEBREAK = "";
AUTHOR
Brian Paulsen <Brian@ThePaulsens.com>, with minor modifications by Lincoln Stein <lstein@cshl.org> for incorporation into the CGI.pm
distribution.
Copyright 1999, Brian Paulsen. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Bug reports and comments to Brian@ThePaulsens.com. You can also write to lstein@cshl.org, but this code looks pretty hairy to me and I'm
not sure I understand it!
SEE ALSO
CGI
perl v5.14.2 2011-01-24 CGI::Pretty(3pm)