in reply to Columnwise parsing of a file
Let's operate under the assumption that you want to sum column 2:
If you want/need to use Perl, and the data in your matrix has fixed length lines... you can unpack itawk '{ sum+=$2} END {print sum}' < matrix.txt
In Section
Seekers of Perl Wisdom