473,398 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

how to get the sum of the values in entire column inside a file?

I have a file, in which one particular column contains integers/float values. How to get the sum of these values of the particular column?
May 4 '12 #1
1 3299
Luuk
1,047 Expert 1GB
A little example of how to do this with awk, and column 3
Expand|Select|Wrap|Line Numbers
  1. ~/tmp> cat file
  2. 1,2,3,4
  3. 2,4,6,8
  4. 5,7,9,13
  5. ~/tmp> awk -F ',' '{ s=s+$3; }END{ print s }' file
  6. 18
  7.  
May 4 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Bigtoga | last post by:
Okay - I'm going crazy here trying to figure out how to do this - here goes: I have a DataList populated by a DataReader. In the DataReader, a column is present called "IsInCategory". I want to...
0
by: velu | last post by:
Problem in storing values from Executescaler() (inside a data grid.) Situation: I have placed a panel inside a datagrid, which populate a table from a database. Now, I run a query to compare...
1
by: svaradan | last post by:
Hi Is it possible to associate a datasource in a datagridview combobox to one cell and not to the entire column? If so how would I go about doing it? Sonny
3
by: Sheau Wei | last post by:
when the result print out , i want to make hyperlink for entire column of ID. what should i do?Below was my php code. //And we display the results while($result = mysql_fetch_array( $data )) ...
2
by: joe | last post by:
how to access invisible column inside gridview
1
by: preeti13 | last post by:
hey i am trying to put the textbox column inside the datagrid but i don't have any idea how to do that please any one help me with this my code is like this: <asp:datagrid id="garidreason"...
2
by: ssjay1981 | last post by:
Hello All, I am new to ms-access, i have a table with values as mentioned below. Each of these table are given with a list of Look up values, in order to narrow down the list of values under...
0
by: Steve Kirby | last post by:
You can't ... What you might try is: desc tabe1 This will list the columns in that table. You can select what you want to pull from that way.
0
by: Mariappan E | last post by:
I have two workbook, one is master file, i want some data pick up from master file how i can use find, if the data is available, copy of entire column & past another work if its not there i want...
1
by: shalskedar | last post by:
I need to copy data from 1 workbook & paste to another workbook which i could do.. but i m not able to paste the data starting from the specific cell... Below is my code Dim wbk As Workbook...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.