Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Columnwise parsing of a file

by mhearse (Chaplain)
on Feb 25, 2013 at 22:07 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1020581]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-19 03:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found