Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 lurking in the Monastery: (4)
As of 2017-03-29 23:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (353 votes). Check out past polls.