Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Columnwise parsing of a file

by mhearse (Chaplain)
on Feb 25, 2013 at 22:07 UTC ( #1020581=note: print w/replies, xml ) Need Help??


in reply to Columnwise parsing of a file

Let's operate under the assumption that you want to sum column 2:
awk '{ sum+=$2} END {print sum}' < matrix.txt
If you want/need to use Perl, and the data in your matrix has fixed length lines... you can unpack it

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1020581]
help
Chatterbox?
beech testing in the sidebar
beech *me* me *me

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2017-03-28 23:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (343 votes). Check out past polls.