473,508 Members | 2,392 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

2 New Member
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
2 5256
julia1128
2 New Member
hmm.. just to clarify. 0.000004 is column 1, 56 is column 2 and 78 is column 3. Thanks!!!!
Mar 29 '10 #2
toolic
70 Recognized Expert New Member
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

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

Similar topics

14
3172
by: Ilias Lazaridis | last post by:
within a python script, I like to create a collection which I fill with values from an external text-file (user editable). How is this accomplished the easiest way (if possible without the need...
5
11922
by: francescomoi | last post by:
Hi. Using PHP 4.3.11, I want my script not to write standard output on the webpage, but on a textfile. I tried with: $variableName = 44;
3
1731
by: Limeburner72 | last post by:
Hi, I'm trying to write a program which reads from a text file but the output is always:Couldn't open a file.The path of file is C:\Perl\perlscripts.Where should I place this text file ?
2
5125
by: Quentin | last post by:
How would I calculate standard deviation of a csv file? Any code examples would be great! Thank you!
2
1234
by: am2007 | last post by:
Hi All, I'm new to perl and would appreciate if you could please help me with this: Perl code which examines lines in a text file, and if the line contains a GenBank ACCESSION, prints out that...
6
5850
by: kumarboston | last post by:
Hi All, I am trying to get an average value for my data, here is my data file DATA FILE EP1934.PDB 250 250 11.27 EP1934.PDB 251 251 12.7332 EP1934.PDB 252 252 6.38341 EP1934.PDB 253 253...
6
3478
by: shibujohn82 | last post by:
Hi, My data set is followed like this... (as tab delimited input.csv) First is column is gene name, second column is bn count, third colums is sh count. ENSRNOG00000000417 42 102...
2
1850
by: Kalpesh Katwala | last post by:
I'm trying to read in a data file into an array. And split it into lines. I've a for loop which will parse the array, split the line (on ",") and execute another command. Here is the code. ...
1
1526
by: Greenwood | last post by:
Im writting a program which read a file choosen by the user, it is a txt. file with some numbers in it like : 98.09809 09.9879 95.35445 after the file has been read, I do some mathematical...
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7120
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7380
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7494
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5050
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1553
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.