Well for example I want to first sum all Total Subs values in all of the 4 region for the city. Then calculate the percentage of this region's Total Subs value over the city total ( 4 regions) Do same thing for each kpi, each region. And finally I want to see an output like:
int percent (int a, int b)
{
if (b/a*100 > 25)
return TRUE;
else
return FALSE;
}
I want to calculate what percentage of a is b.
say if b = 48, a = 100
so b is 48% of a
but wouldnt b/a give me 0 ??? what can be done ?? (6 Replies)
Hi, I am having the file which contains the following two columns.
518 _factorial
256 _main
73 _atol
52 ___do_global_ctors
170 ___main
52 ___do_g
How can calculate the percentage of each value in the first column ?
first need to get the sum of the first column and... (3 Replies)
i have 3 files like
total.dat=18
equal.dat=14
notequal.dat=16
i need find the equal percentange means:
equalpercentage = ($equal.dat / $total.dat * 100)
How i can do this ?
I tried some of the answers to calculate the percentage in this forums.but it couldn't worked.Some one please... (6 Replies)
Hi
I need a awk script to calculate percentage.
I have to pass the pararmeters in to the awk script and calculate the percentage.
Sum = 50
passed = 43
failed = 7
I need to pass these value in to the awk script and calculate the percentage.
Please advice me. (8 Replies)
A short excerpt of my .txt file looks like:
CXRA3Z2J9MQKR B
CXRA3Z2J9MQKR A
CXRA3Z2J9MQKR C
CXRA3Z2J9MQKR B
A162JX4ML69UIC C
A162JX4ML69UIC A
FZ9Z19TI2XOA5 A
FZ9Z19TI2XOA5 C
FZ9Z19TI2XOA5 B
FZ9Z19TI2XOA5 B
BRNTTJUB8GXE9 A
BRNTTJUB8GXE9 A
... (7 Replies)
hello,
please can you help me.
jj and kk are two numbers which are the result of an sql program.
I would like to calculate the ratio jj/kk*100.
I have done this:
ratio=$((jj/kk * 100)) or ratio=`expr $jj \/ expr $kk) but the result is 0
What can i do?
Thanks for help. (3 Replies)
Input File:
5081
2058
175
8282
2358
7347
6612
3459
END OF INPUT FILE
I need to know how to calculate minimum,maximum,average of the values in the file and also what percentage is the values over some user defined value for example 1000 and what percentage of value is over 5000.
By... (2 Replies)
Need an awk script to calculate the percentage of value field and replace
I have a input file called file.txt with the following content:
john|622.5674603562933|8|br:1;cn:3;fr:1;jp:1;us:2
andy|0.0|12|**:3;br:1;ca:2;de:2;dz:1;fr:2;nl:1
in fourth filed of input file, calulate percentage of each... (1 Reply)
Hello,
Ive got a bunch of numbers here e.g:
6065
6094
6348
6297
6161
6377
6338
6290
How do I find out if there is a difference between 10% or more between one of these numbers ? I am trying to do this in Bash.. but no luck so far.. Does anyone have an Idea ??
Thanx,
- Pascal... (9 Replies)
I have a input text file in this format:
ITEM1 10.9 20.1
ITEM2 11.6 12
ITEM3 14 15.7
ITEM5 20 50.6
ITEM6 25 23.6
I want to print those lines which have more than 5% difference between second and third columns. (8 Replies)
Discussion started by: ctrld
8 Replies
LEARN ABOUT REDHAT
xml::handler::subs
XML::Handler::Subs(3) User Contributed Perl Documentation XML::Handler::Subs(3)NAME
XML::Handler::Subs - a PerlSAX handler base class for calling user-defined subs
SYNOPSIS
use XML::Handler::Subs;
package MyHandlers;
use vars qw{ @ISA };
sub s_NAME { my ($self, $element) = @_ };
sub e_NAME { my ($self, $element) = @_ };
$self->{Names}; # an array of names
$self->{Nodes}; # an array of $element nodes
$handler = MyHandlers->new();
$self->in_element($name);
$self->within_element($name);
DESCRIPTION
"XML::Handler::Subs" is a base class for PerlSAX handlers. "XML::Handler::Subs" is subclassed to implement complete behavior and to add
element-specific handling.
Each time an element starts, a method by that name prefixed with `s_' is called with the element to be processed. Each time an element
ends, a method with that name prefixed with `e_' is called. Any special characters in the element name are replaced by underscores.
Subclassing XML::Handler::Subs in this way is similar to XML::Parser's Subs style.
XML::Handler::Subs maintains a stack of element names, `"$self-"{Names}', and a stack of element nodes, `"$self-"{Nodes}>' that can be used
by subclasses. The current element is pushed on the stacks before calling an element-name start method and popped off the stacks after
calling the element-name end method. The `"in_element()"' and `"within_element()"' calls use these stacks.
If the subclass implements `"start_document()"', `"end_document()"', `"start_element()"', and `"end_element()"', be sure to use `"SUPER::"'
to call the the superclass methods also. See perlobj(1) for details on SUPER::. `"SUPER::start_element()"' and `"SUPER::end_element()"'
return 1 if an element-name method is called, they return 0 if no method was called.
XML::Handler::Subs does not implement any other PerlSAX handlers.
XML::Handler::Subs supports the following methods:
new( OPTIONS )
A basic `"new()"' method. `"new()"' takes a list of key, value pairs or a hash and creates and returns a hash with those options; the
hash is blessed into the subclass.
in_element($name)
Returns true if `$name' is equal to the name of the innermost currently opened element.
within_element($name)
Returns the number of times the `$name' appears in Names.
AUTHOR
Ken MacLeod, ken@bitsko.slc.ut.us
SEE ALSO perl(1), PerlSAX.pod(3)perl v5.8.0 2000-02-22 XML::Handler::Subs(3)