Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Compare sum of two columns if variance is zero do nothing else send an email Post 303018234 by Tahir_M on Friday 1st of June 2018 06:44:21 AM
Old 06-01-2018
Replying:

No, I didn't change anything. However, to be precise I used two new files and still got the variance.

When you run this in unix, are you getting a variance of 0?
Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Unable to send eMail from a UNIX-Host ( using mailx ) to a Outlook-email-addres(Win)

Hi A) I am able to send eMail using mailx from a UNIX ( solaris 8 ) host to my Outlook-email-ID : FName.Surname@Citigroup.com ( This is NOT my actual -eMail-ID). But in Outlook the "From :" eMail address is displayed as " usr1@unix-host1.unregistered.email.citicorp.com " .i.e the words... (2 Replies)
Discussion started by: Vetrivela
2 Replies

2. Shell Programming and Scripting

Sum of three columns - in 4N columns file

Hi All, happy new year. I have a file with 4xN columns like 0.0000e+00 0.0000e+00 7.199E+07 7.123E+07 6.976E+07 6.482E+07 5.256E+07 2.523E+07 0.0000e+00 0.0000e+00 8.641E+07 8.550E+07 8.373E+07 7.780E+07 6.309E+07 3.028E+07... (8 Replies)
Discussion started by: f_o_555
8 Replies

3. Solaris

Send an email from Solaris using Linux email server

Hello everyone I have a problem and I need your help: I have a Solaris 10 and Solaris 8 UNIX Servers, and Linux Centos4 as email server. I need send an email from Solaris servers preferably using Centos4 email server. I have no mail service configured in my Solaris computers (1 Reply)
Discussion started by: aflores
1 Replies

4. Shell Programming and Scripting

Script to send email after comparing the folder permissions to a certain permission & send email

Hello , I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them . I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies

5. UNIX for Dummies Questions & Answers

new to ldap, send email to a ou or group, and see a list from email client

hi, i'm running openldap on ubuntu 10.04, creating new items with apache directory studio (windows version). i use the ldap just as an address book to our small office (email clients are windows live mail 2009, 2011, microsoft outlook 2007 and 2010). a. i cant see a list of the contacts,... (0 Replies)
Discussion started by: V4705
0 Replies

6. Shell Programming and Scripting

Evaluate 2 columns, add sum IF two columns match on two rows

Hi all, I know this sounds suspiciously like a homework course; but, it is not. My goal is to take a file, and match my "ID" column to the "Date" column, if those conditions are true, add the total number of minutes worked and place it in this file, while not printing the original rows that I... (6 Replies)
Discussion started by: mtucker6784
6 Replies

7. Shell Programming and Scripting

Get the SUM of TWO columns SEPARATELY by doing GROUP BY on other columns

My File looks like: "|" -> Field separator A|B|C|100|1000 D|E|F|1|2 G|H|I|0|7 D|E|F|1|2 A|B|C|10|10000 G|H|I|0|7 A|B|C|1|100 D|E|F|1|2 I need to do a SUM on Col. 5 and Col.6 by grouping on Col 1,2 & 3 My expected output is: A|B|C|111|11100 (2 Replies)
Discussion started by: machomaddy
2 Replies

8. Shell Programming and Scripting

Compare 2 csv files by columns, then extract certain columns of matcing rows

Hi all, I'm pretty much a newbie to UNIX. I would appreciate any help with UNIX coding on comparing two large csv files (greater than 10 GB in size), and output a file with matching columns. I want to compare file1 and file2 by 'id' and 'chain' columns, then extract exact matching rows'... (5 Replies)
Discussion started by: bkane3
5 Replies

9. Shell Programming and Scripting

Evaluate 2 columns, add sum IF two columns satisfy the condition

HI All, I'm embedding SQL query in Script which gives following output: Assignee Group Total ABC Group1 17 PQR Group2 5 PQR Group3 6 XYZ Group1 10 XYZ Group3 5 I have saved the above output in a file. How do i sum up the contents of this output so as to get following output: ... (4 Replies)
Discussion started by: Khushbu
4 Replies

10. UNIX for Beginners Questions & Answers

Group by columns and add sum in new columns

Dear Experts, I have input file which is comma separated, has 4 columns like below, BRAND,COUNTRY,MODEL,COUNT NIKE,USA,DUMMY,5 NIKE,USA,ORIGINAL,10 PUMA,FRANCE,DUMMY,20 PUMA,FRANCE,ORIGINAL,15 ADIDAS,ITALY,DUMMY,50 ADIDAS,ITALY,ORIGINAL,50 SPIKE,CHINA,DUMMY,1O And expected output add... (2 Replies)
Discussion started by: ricky1991
2 Replies
Statistics::OnLine(3pm) 				User Contributed Perl Documentation				   Statistics::OnLine(3pm)

NAME
Statistics::OnLine - Pure Perl implementation of the on-line algorithm to produce statistics SYNOPSIS
use Statistics::OnLine; my $s = Statistics::OnLine->new; my @data = (1, 2, 3, 4, 5); $s->add_data( @data ); $s->add_data( 6, 7 ); $s->add_data( 8 ); print "count = ",$s->count," mean = ",$s->mean," variance = ",$s->variance," variance_n = ", $s->variance_n," skewness = ",$s->skewness," kurtosis = ",$s->kurtosis," "; $s->add_data( ); # does nothing! print "count = ",$s->count," mean = ",$s->mean," variance = ",$s->variance," variance_n = ", $s->variance_n," skewness = ",$s->skewness," kurtosis = ",$s->kurtosis," "; $s->add_data( 9, 10 ); print "count = ",$s->count," mean = ",$s->mean," variance = ",$s->variance," variance_n = ", $s->variance_n," skewness = ",$s->skewness," kurtosis = ",$s->kurtosis," "; DESCRIPTION
This module implements a tool to perform statistic operations on large datasets which, typically, could not fit the memory of the machine, e.g. a stream of data from the network. Once instantiated, an object of the class provide an "add_data" method to add data to the dataset. When the computation of some statistics is required, at some point of the stream, the appropriate method can be called. After the execution of the statistics it is possible to continue to add new data. In turn, the object will continue to update the existing data to provide new statistics. METHODS
new() Creates a new "Statistics::OnLine" object and returns it. add_data(@) Adds new data to the object and updates the internal state of the statistics. The method return the object itself in order to use it in chaining: my $v = $s->add_data( 1, 2, 3, 4 )->variance; clean() Cleans the internal state of the object and resets all the internal statistics. Return the object itself in order to use it in chaining: my $v = $s->clean->add_data( 1, 2, 3, 4 )->variance; count() Returns the actual number or elements inserted and processed by the object. mean() Returns the average of the elements inserted into the system: fract{ sum_1^n{x_i} }{ n } variance() Returns the variance of the element inserted into the system: fract{ sum_1^n{avg - x_i} }{ n - 1 } variance_n() Returns the variance of the element inserted into the system: fract{ sum_1^n{avg - x_i} }{ n } skewness() Returns the skewness (third standardized moment) of the element inserted into the system <http://en.wikipedia.org/wiki/Skewness> kurtosis() Returns the kurtosis (fourth standardized moment) of the element inserted into the system <http://en.wikipedia.org/wiki/Kurtosis> ERROR MESSAGES
The conditions in which the system can return errors, using a "die" are: too few elements to compute function Some functions need a minimum number of elements to be computed: "mean", "variance_n" and "skewness" need at least one element, "variance" at least two and "kurtosis" needs at least four. variance is zero: cannot compute kurtosis|skewness Both kurtosis and skewness need that variance to be greater than zero. THEORY
On-line statistics are based on strong mathematical foundations which transform the standard computations into a sequence of operations that incrementally update with new values the actual ones. There are some referencence in the web. This documentation suggest to start your investigation from <http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Higher-order_statistics>. The linked page provides other useful references on the foundations of the method. CAVEAT
The module is intended to be used in all the situations in which:(1) the number of data elements could be too large with respect the memory of the system, or(2) the elements arrive at different time stamps and intermediate results are needed. If the length of the stream is fixed, all the data elements are present in a single place and there is not need for intermediate results, it could be better to use different modules, for instance Statistics::Lite, to make computations. The reason for this choice is that the module uses a stable approximation, well suited for the use on steams (effectively an on-line algorithm). Using this system on fixed datasets could introduce some (little) approximation. HISTORY
0.02 Corrected typos in documentation 0.01 Initial version of the module AUTHOR
Francesco Nidito COPYRIGHT
Copyright 2009 Francesco Nidito. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Statistics::Lite, <http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Higher-order_statistics> perl v5.10.1 2009-09-04 Statistics::OnLine(3pm)
All times are GMT -4. The time now is 09:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy