![]() |
sum of output
i've got a file, say;
Code:
6820 |
You could use for example the language awk on a script bash.
Calculate sum and average of multiple lines - awk in bash |
Quote:
Can you use this script.sh ? Code:
#!/bin/bash Code:
sh script.sh /path/to/file/where/numbers/are/stored |
Code:
awk 'BEGIN{s=0}{s+=$1}END{print s}' file Evo2. |
try to put in some effort next time
Code:
awk '{s+=$0}END{print s}' file |
There was a post in the programming section with this question:
http://www.linuxquestions.org/questi...6/#post3414768 |
For completeness:
Open the file with a spreadsheet program and use the summation button. |
Quote:
|
Quote:
Cheers, Evo2. |
Quote:
|
Quote:
|
Quote:
|
Ohh, the comedy!
Evo2. |
All times are GMT -5. The time now is 06:35 PM. |