07-25-2008
Yeah...I thought about doing it that way, I had just hoped there was cleaner way of doing it.
Thanks.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have some data that is something like this?
item: onhand counted location
ITEM0001 1 0 a1
ITEM0001 0 1 a2
ITEM0002 5 0 b5
ITEM0002 0 6 c1
I want to sum up... (6 Replies)
Discussion started by: syadnom
6 Replies
2. UNIX for Dummies Questions & Answers
Hi All,
I have the following input which i want to process using AWK.
Rows,NC,amount
1,1202,0.192387
2,1201,0.111111
3,1201,0.123456
i want the following output
count of rows = 3 ,sum of amount = 0.426954
Many thanks (2 Replies)
Discussion started by: pistachio
2 Replies
3. Shell Programming and Scripting
Hi All,
I am another biologist attempting to parse a large txt file containing several million lines like:
tucosnp 56762 T Y 228 228 60 23 .CcCcc,,..c.c,cc,,.C...
What I need to do is get the frequency of periods (.) plus commas (,) in column 9, and populate this number into another... (1 Reply)
Discussion started by: peromhc
1 Replies
4. Shell Programming and Scripting
Hi Experts, I am trying to sum multiple columns and rows with awk ,
I want the sum of :
1] Horizontal Sum: (rows sum):
2] Vertical Sum: (Column's sum]
details:
# cat file1
10 11 12 13 14 15 16 17 18 19
20 21 22 23 24 25 26 27 28 29
40 31 32 33 34 35 36 37 38 39
70 41 42 43 44... (2 Replies)
Discussion started by: rveri
2 Replies
5. Shell Programming and Scripting
Hi,
I am using the following code to find the sum of the values of column 286 in a file. It will have the Decimal values with the scale of 2. Delimiter is '|^'
cut -d'|^' -f286 filename|cut -c3-| awk '{ x += $1 } END { printf("%.2f\n", x) }'
There are around 50k records in this file... (2 Replies)
Discussion started by: Jram
2 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I am new to Linux environment , I working on Linux script which should send auto email based on the specific condition from log file. Below is the sample log file
Name m/c usage
abc xxx 10
abc xxx 20
abc xxx 5
xyz ... (6 Replies)
Discussion started by: asjaiswal
6 Replies
7. Shell Programming and Scripting
Hi,
I have a similar input format-
A_1 2
B_0 4
A_1 1
B_2 5
A_4 1
and looking to print in this output format with headers. can you suggest in awk?awk because i am doing some pattern matching from parent file to print column 1 of my input using awk already.Thanks!
letter number_of_letters... (5 Replies)
Discussion started by: prashob123
5 Replies
8. Shell Programming and Scripting
i have multiple files with Batch Header, Record detail & Batch trailer data in the files like :
BH 20150225950050N8262
RD 20140918000000 99999999 unk Deferred Settlement -13950
BT01 -13950
*Above sample data donot have the spaces coorectly defined. I do have multiple batch trailer... (1 Reply)
Discussion started by: kcdg859
1 Replies
9. Shell Programming and Scripting
Hi Experts,
Please bear with me, i need help
I am learning AWk and stuck up in one issue.
First point : I want to sum up column value for column 7, 9, 11,13 and column15 if rows in column 5 are duplicates.No action to be taken for rows where value in column 5 is unique.
Second point : For... (1 Reply)
Discussion started by: as7951
1 Replies
10. UNIX for Beginners Questions & Answers
I have two files, file1.table is the count table, and the other is the range condition file2.range.
file1.table
chr start end count
N1 0 48 1
N1 48 181 2
N1 181 193 0
N1 193 326 2
N1 326 457 0
N1 457 471 1
N1 471 590 2
N1 590 604 1
N1 604 752 1
N1 752 875 1
file2.range... (12 Replies)
Discussion started by: yifangt
12 Replies
LEARN ABOUT CENTOS
ppi::html
PPI::HTML(3) User Contributed Perl Documentation PPI::HTML(3)
NAME
PPI::HTML - Generate syntax-hightlighted HTML for Perl using PPI
SYNOPSIS
use PPI;
use PPI::HTML;
# Load your Perl file
my $Document = PPI::Document->load( 'script.pl' );
# Create a reusable syntax highlighter
my $Highlight = PPI::HTML->new( line_numbers => 1 );
# Spit out the HTML
print $Highlight->html( $Document );
DESCRIPTION
PPI::HTML converts Perl documents into syntax highlighted HTML pages.
HISTORY
PPI::HTML is the successor to the now-redundant PPI::Format::HTML.
While early on it was thought that the same formatting code might be able to be used for a variety of different types of things (ANSI and
HTML for example) later developments with the here-doc code and the need for independantly written serializers meant that this idea had to
be discarded.
In addition, the old module only made use of the Tokenizer, and had a pretty shit API to boot.
API Overview
The new module is much cleaner. Simply create an object with the options you want, pass PPI::Document objects to the "html" method, and you
get strings of HTML that you can do whatever you want with.
METHODS
new %args
The "new" constructor takes a simple set of key/value pairs to define the formatting options for the HTML.
page
Is the "page" option is enabled, the generator will wrap the generated HTML fragment in a basic but complete page.
line_numbers
At the present time, the only option available. If set to true, line numbers are added to the output.
colors | colours
For cases where you don't want to use an external stylesheet, you can provide "colors" as a hash reference where the keys are CSS
classes (generally matching the token name) and the values are colours.
This allows basic colouring without the need for a whole stylesheet.
css The "css" option lets you provide a custom CSS::Tiny object containing any CSS you want to apply to the page (if you are using page
mode).
If both the "colors" and "css" options are used, the colour CSS entries will overwrite anything contained in the CSS::Tiny object. The
object will also be cloned if it to be modified, to prevent destroying any CSS objects passed in.
Returns a new PPI::HTML object
css
The "css" accessor returns the CSS::Tiny object originally provided to the constructor.
html $Document | $file | $source
The main method for the class, the "html" method takes a single PPI::Document object, or anything that can be turned into a PPI::Document
via its "new" method, and returns a string of HTML formatted based on the arguments given to the "PPI::HTML" constructor.
Returns a string, or "undef" on error.
SUPPORT
Bugs should always be submitted via the CPAN bug tracker
<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=PPI-HTML>
For other issues, contact the maintainer
AUTHOR
Adam Kennedy <adamk@cpan.org>
Funding provided by The Perl Foundation
SEE ALSO
<http://ali.as/>, PPI
COPYRIGHT
Copyright 2005 - 2009 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.16.3 2009-11-16 PPI::HTML(3)