Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Columnwise parsing of a file

by mhearse (Hermit)
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


Comment on Re: Columnwise parsing of a file
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1020581]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2015-07-29 08:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (261 votes), past polls