By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,363 Members | 2,961 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,363 IT Pros & Developers. It's quick & easy.

Perl calculate average and standard deviation from specified column of a text file

P: 2
Hi all,

I'm a newbie to perl, really need some help. It seemed to be a very simple question but I kept getting wrong answers... Thanks in advance!!

The text file looks like this:
0.000004 56 78
0.000005 67 89
0.000006 78 23
0.000007 12 56

I need to calculate the average and standard deviation for the 2nd and 3rd column . Thank you so much!!

I appreciate any suggestions :)
Mar 29 '10 #1
Share this Question
Share on Google+
2 Replies


P: 2
hmm.. just to clarify. 0.000004 is column 1, 56 is column 2 and 78 is column 3. Thanks!!!!
Mar 29 '10 #2

Expert
P: 70
Use the "avg" and "stddev" functions in the CPAN Acme::Tools module:

http://search.cpan.org/~kjetil/Acme-Tools/Tools.pm
Mar 30 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.