Created
August 7, 2014 18:41
-
-
Save raypereda/e63f8e0494cf8b3b0948 to your computer and use it in GitHub Desktop.
ruby sum columns of a text file (better than awk)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat temp.txt | ruby -nae 'BEGIN { x = 0 }; puts "#{ x += $F[0].to_f }"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment