perl -ne "END { print(qq{Total: $t\n}); } $t += (split ',')[99]" file