Skip to content

Instantly share code, notes, and snippets.

@raypereda
Created August 7, 2014 18:41
Show Gist options
  • Save raypereda/e63f8e0494cf8b3b0948 to your computer and use it in GitHub Desktop.
Save raypereda/e63f8e0494cf8b3b0948 to your computer and use it in GitHub Desktop.
ruby sum columns of a text file (better than awk)
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