Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Calculating Row Averages From a CSV File

by Prof Vince (Friar)
on Aug 15, 2007 at 14:08 UTC ( #632746=note: print w/replies, xml ) Need Help??


in reply to Calculating Row Averages From a CSV File

Or a good ol' one-liner :

perl -Mstrict -MList::Util=sum -wlne 'my @a = grep $_, split /,/; print shift @a, ":", sum(@a) / @a"' test.dat

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://632746]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2017-02-27 01:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (376 votes). Check out past polls.