Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Summing numbers in a file

by parv (Vicar)
on May 30, 2020 at 07:51 UTC ( #11117497=note: print w/replies, xml ) Need Help??


in reply to Summing numbers in a file

In addition to what kcott wrote, there are Math::Expression & Math::Symbolic.

# No need perl. # For numbers all by their lonesome on a line. awk 'BEGIN { sum = 0 } END { print sum } { sum += $1 }' in > out

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11117497]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2020-10-20 15:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (210 votes). Check out past polls.

    Notices?