01-30-2009
sum of column with condition
1 IT 50
2 IT 40
3 Finance 200
4 MP 30
5 MP 10
6 HQ 30
how to use awk to make it display it like this
IT 90
MP 40
HQ 30
Finance 200
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I've shown an example of what I would like to achieve below. In the example file, I would like to sum the values in column 2 for each distinct category in column 3 (presumably making an array?) and print the sum as well as the category name and length (note:length always corresponds with... (8 Replies)
Discussion started by: auburn
8 Replies
2. Shell Programming and Scripting
Hi all,
I have question on how to sum up a column with "condition" for following listing example
imvprd_lun01 34 imvprd_pool01 admin 19
imv1prd_lun01 188 IMBDW_N0 imvprd_pool01 admin 133
imv1prd_lun02 1236 IMBDW_N1 imvprd_pool01 admin 1125
imv1prd_lun03... (2 Replies)
Discussion started by: ckwan
2 Replies
3. Shell Programming and Scripting
I have a following inputfile
MT,AP,CDM,TTML,MUM,GS,SUCC,3
MT,AP,CDM,TTSL,AP,GS,FAIL,9
MT,AP,CDM,RCom,MAH,GS,SUCC,3
MT,AP,CDM,RTL,HP,GS,SUCC,1
MT,AP,CDM,Uni,UPE,GS,SUCC,2
MT,AP,CDM,Uni,MUM,GS,SUCC,2
TTSL,AP,GS,MT,MAH,CDM,SUCC,20
TTML,AP,GS,MT,MAH,CDM,FAIL,10... (2 Replies)
Discussion started by: siramitsharma
2 Replies
4. Shell Programming and Scripting
Hi,
I have a similar input format-
A_1 2
B_0 4
A_1 1
B_2 5
A_4 1
and looking to print in this output format with headers. can you suggest in awk?awk because i am doing some pattern matching from parent file to print column 1 of my input using awk already.Thanks!
letter number_of_letters... (5 Replies)
Discussion started by: prashob123
5 Replies
5. Shell Programming and Scripting
Hi,
I have a table to be imported for R as matrix or data.frame but I first need to edit it because I've got several lines with the same identifier (1st column), so I want to sum the each column (2nd -nth) of each identifier (1st column)
The input is for example, after sorted:
K00001 1 1 4 3... (8 Replies)
Discussion started by: sargotrons
8 Replies
6. UNIX for Dummies Questions & Answers
Dear masters,
I have file input
011171646073|12129|12129|A027|20141001|20141015|2014|10|01|2013|10|15
011171646076|12129|12129|A027|20141001|20141012|2014|10|01|2014|09|12
011171646078|12129|12129|A027|20141001|20141015|2014|10|01|2014|10|15... (6 Replies)
Discussion started by: radius
6 Replies
7. UNIX for Dummies Questions & Answers
Hi All,
I have a requirement where I need to find sum of values from column D through O present in a CSV file and check whether the sum of each Individual column matches with the value present for that corresponding column present in the trailer record.
For example, let's assume for column D... (9 Replies)
Discussion started by: tpk
9 Replies
8. UNIX for Beginners Questions & Answers
I have a file which need to be summed up using date column.
I/P:
2017/01/01 a 10
2017/01/01 b 20
2017/01/01 c 40
2017/01/01 a 60
2017/01/01 b 50
2017/01/01 c 40
2017/01/01 a 20
2017/01/01 b 30
2017/01/01 c 40
2017/02/01 a 10
2017/02/01 b 20
2017/02/01 c 30
2017/02/01 a 10... (6 Replies)
Discussion started by: Booo
6 Replies
9. Shell Programming and Scripting
Hi Experts,
Please bear with me, i need help
I am learning AWk and stuck up in one issue.
First point : I want to sum up column value for column 7, 9, 11,13 and column15 if rows in column 5 are duplicates.No action to be taken for rows where value in column 5 is unique.
Second point : For... (1 Reply)
Discussion started by: as7951
1 Replies
10. Shell Programming and Scripting
Hello,
I am trying to store sum of a column as a new column inside a file but have to find the column names dynamically
I/p
c1,c2,c3,c4,c5
10,20,30,40,50
20,30,40,50,60
If i want to find sum only column c1, c3 and output it as c6,c7
O/p
c1,c2,c3,c4,c5,c6,c7
10,20,30,40,50,30,70... (6 Replies)
Discussion started by: mkathi
6 Replies
LEARN ABOUT DEBIAN
finance::quote::lerevenu
Finance::Quote::LeRevenu(3pm) User Contributed Perl Documentation Finance::Quote::LeRevenu(3pm)
NAME
Finance::Quote::LeRevenu - Obtain quotes from http://bourse.lerevenu.com.
SYNOPSIS
use Finance::Quote;
$q = Finance::Quote->new;
%info = Finance::Quote->fetch("LeRevenu","FR0000031122"); # Only query LeRevenu
%info = Finance::Quote->fetch("france","ml"); # Failover to other sources OK.
DESCRIPTION
This module fetches information from the "Paris Stock Exchange", http://bourse.lerevenu.com. All stocks are available.
This module is loaded by default on a Finance::Quote object. It's also possible to load it explicity by placing "LeRevenu" in the argument
list to Finance::Quote->new().
This module provides both the "lerevenu" and "france" fetch methods. Please use the "france" fetch method if you wish to have failover
with future sources for French stocks. Using the "lerevenur" method will guarantee that your information only comes from the Paris Stock
Exchange.
Information obtained by this module may be covered by http://bourse.lerevenu.com terms and conditions See http://bourse.lerevenu.com for
details.
LABELS RETURNED
The following labels may be returned by Finance::Quote::LeRevenu : name, last, date, p_change, open, high, low, close, volume, currency,
method, exchange.
SEE ALSO
Le Revenu, http://bourse.lerevenu.com
perl v5.14.2 2014-03-03 Finance::Quote::LeRevenu(3pm)