Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Summing numbers in a file

by parv (Parson)
on May 30, 2020 at 07:51 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11117497]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (1)
As of 2024-04-24 15:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found