Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
sum digits in the line
perl -pe 's/\d*/$s+=$&/ge}{$_=$s' file
perl -F= -pe '$s+=$F[1]}{print $s' file
awk -F= '{sum+=$2};END{print sum}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.