how would you calculate percentage by per line? Given a column of 16 lines, grab each line and divide it by the sum of the entire column and multiply by 100?
thanks ... (8 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)
Hi,
I have a log like this :
actually i want to get the log like this :
where % can get from :
100 * pmTotNoRrcConnectReqSucc / pmTotNoRrcConnectReq
Thanks in advance.. :) (8 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)
Hi all,
I havea log of data.log
bear,10000,white
bear,5000,black
chicken,2000,white
chicken,4000,yellow
chicken,3000,black
lion,6000,yellow
lion,1000,white
How can we have shell script to get the percentage of each animals?
Thanks. (8 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)
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 sub filed seperated by ; semicolon and replace value with percentage .
i... (11 Replies)
Hello,
I am trying to compute the percentage in a script as shown below:
PerCover=`echo "scale=2 ; 100 \* ($InputCover/$Total)" | bc`
However the PerCover value is blank/null. What do I need to do differently?
Thanks for your input!
~Guss (1 Reply)
Hi All,
I currently have a shell script which is pulling multiple counters from various sources. Due to the counters being cumulative counters I've got some code to work out the delta from the last reading and current which is working fine.
The problem i have now is being able to work out the... (8 Replies)
Discussion started by: mutley2202
8 Replies
LEARN ABOUT DEBIAN
test::image::gd
Test::Image::GD(3pm) User Contributed Perl Documentation Test::Image::GD(3pm)NAME
Test::Image::GD - A module for testing images using GD
SYNOPSIS
use Test::More plan => 1;
use Test::Image::GD;
cmp_image('test.gif', 'control.gif', '... these images should match');
# or
my $test = GD::Image->new('test.gif');
my $control = GD::Image->new('control.gif');
cmp_image($test, $control, '... these images should match');
# some other test functions ...
size_ok('camel.gif', [ 100, 350 ], '... the image is 100 x 350");
height_ok('test.gif', 200, '... the image has a height of 200');
width_ok('test.gif', 200, '... the image has a width of 200');
DESCRIPTION
This module is meant to be used for testing custom graphics, it attempts to "visually" compare the images, this means it ignores invisible
differences like color palettes and metadata. It also provides some extra functions to check the size of the image.
FUNCTIONS
cmp_image ($got, $expected, $message)
This function will tell you whether the two images will look different, ignoring differences in the order of colors in the color
palette and other invisible changes.
Both $got and $expected can be either instances of "GD::Image" or either a file handle or a file path (both are valid parameters to the
"GD::Image" constructor).
size_ok ($got, [ $width, $height ], ?$message)
This function will check if an image is a certain size.
As with the "cmp_image" function, the $got parameter can be either an instance of "GD::Image" or a file handle or a file path (all are
valid parameters to the "GD::Image" constructor).
height_ok ($got, $height, ?$message)
This function will check if an image is a certain height.
As with the "cmp_image" function, the $got parameter can be either an instance of "GD::Image" or a file handle or a file path (all are
valid parameters to the "GD::Image" constructor).
width_ok ($got, $width, ?$message)
This function will check if an image is a certain width.
As with the "cmp_image" function, the $got parameter can be either an instance of "GD::Image" or a file handle or a file path (all are
valid parameters to the "GD::Image" constructor).
TO DO
Add more functions
This module currently serves a very basic need of mine, however, I am sure as I start writing more tests against images I will find a
need for other testing functions. Any suggestions are welcome.
BUGS
None that I am aware of. Of course, if you find a bug, let me know, and I will be sure to fix it.
CODE COVERAGE
I use Devel::Cover to test the code coverage of my tests, below is the Devel::Cover report on this module test suite.
---------------------------- ------ ------ ------ ------ ------ ------ ------
File stmt bran cond sub pod time total
---------------------------- ------ ------ ------ ------ ------ ------ ------
Test/Image/GD.pm 100.0 91.7 63.6 100.0 100.0 100.0 93.7
---------------------------- ------ ------ ------ ------ ------ ------ ------
Total 100.0 91.7 63.6 100.0 100.0 100.0 93.7
---------------------------- ------ ------ ------ ------ ------ ------ ------
SEE ALSO
The "compare" function of "GD::Image" class, that is how this "cmp_image" is implemented.
AUTHOR
Stevan Little, <stevan@iinteractive.com>
COPYRIGHT AND LICENSE
Copyright 2005 by Infinity Interactive, Inc.
<http://www.iinteractive.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2005-12-09 Test::Image::GD(3pm)