Sponsored Content
Top Forums Shell Programming and Scripting Column sum group by uniq records Post 302287938 by sandeep13 on Monday 16th of February 2009 04:27:27 AM
Old 02-16-2009
Column sum group by uniq records

Hi Jadu,

I am new to unix and i have a similar requirement given below:

Input file:

Test.txt
PORT; ID; TOTAL
port1;p1;100000
port2;p2;5000
port1;p1;500

Output file:
PORT; ID; TOTAL
port1;p1; 100500
port2;p2; 5000

How can achive this? Any help on this regard is higly appreciated.
Thanks.

Regards,
Sandeep
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to calculate a sum of certain records?

Hi, i have a file where the records are like this. vt100 2048 D402 MG0010 0 586 262144 D403 MG0011 1000 486 8192 D404 MG0012 270 386 8192 A423 CC0177 40 586 65536 A424 CC0182 670 486 16384 A423 CC0183 100 486 16384 A425 CC0184 80 65000 4096 B407 EE1027 80 I want firstly, to count how... (10 Replies)
Discussion started by: sickboy
10 Replies

2. Shell Programming and Scripting

Merge group numbers and add a column containing group names

I have a file in the following format. Groups of data merge together and the group number is indicated above each group. 1 adrf dfgr dfg 2 dfgr dfgr 3 dfef dfr fd 4 fgrt fgr fgg 5 fgrt fgr (3 Replies)
Discussion started by: Lucky Ali
3 Replies

3. Shell Programming and Scripting

Merge group numbers and add a column containing group names

Hi All I do have a file like this with 6 columns. Groups of data merge together and the group number is indicated above each group. 1 1 12 26 289 3.2e-027 GCGTATGGCGGC 2 12 26 215 6.7e+006 TTCCACCTTTTG 3 9 26 175 ... (1 Reply)
Discussion started by: Lucky Ali
1 Replies

4. Shell Programming and Scripting

Sum of column by group wise

Hello All , I have a problem with summing of column by group Input File - COL_1,COL_2,COL_3,COL_4,COL_5,COL_6,COL_7,COL_8,COL_9,COL_10,COL_11 3010,21,1923D ,6,0,0.26,0,0.26,-0.26,1,200807 3010,21,192BI ,6,24558.97,1943.94,0,1943.94,22615.03,1,200807 3010,21,192BI... (8 Replies)
Discussion started by: jambesh
8 Replies

5. Shell Programming and Scripting

Sum up the column values group by using some field

12-11-2012,PNL,158406 12-11-2012,RISK,4564 12-11-2012,VAR_1D,310101 12-11-2012,VAR_10D,310101 12-11-2012,CB,866 12-11-2012,STR_VAR_1D,298494 12-11-2012,STR_VAR_10D,309623 09-11-2012,PNL,1024106 09-11-2012,RISK,4565 09-11-2012,VAR_1D,317211 09-11-2012,VAR_10D,317211 09-11-2012,CB,985... (7 Replies)
Discussion started by: manas_ranjan
7 Replies

6. Shell Programming and Scripting

awk to sum a column based on duplicate strings in another column and show split totals

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

7. Shell Programming and Scripting

Sum column values based in common identifier in 1st column.

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

8. UNIX for Dummies Questions & Answers

Match sum of values in each column with the corresponding column value present in trailer record

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

9. Shell Programming and Scripting

Bring values in the second column into single line (comma sep) for uniq value in the first column

I want to bring values in the second column into single line for uniq value in the first column. My input jvm01, Web 2.0 Feature Pack Library jvm01, IBM WebSphere JAX-RS jvm01, Custom01 Shared Library jvm02, Web 2.0 Feature Pack Library jvm02, IBM WebSphere JAX-RS jvm03, Web 2.0 Feature... (10 Replies)
Discussion started by: kchinnam
10 Replies

10. Shell Programming and Scripting

awk to Sum columns when other column has duplicates and append one column value to another with Care

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
gufw(8) 						      System Manager's Manual							   gufw(8)

NAME
Gufw - Graphic user interface for managing ufw DESCRIPTION
Gufw is an easy to use Ubuntu / Linux firewall, powered by ufw. Gufw is an easy, intuitive, way to manage your Ubuntu firewall. It supports common tasks such as allowing or blocking pre-configured, com- mon p2p, or individual ports port(s), and many others! Gufw is powered by ufw. Introduction iptables is already a very powerful tool by itself, but it's syntax can get awkward at times and hard to figure out, so Ubuntu developers decided to make ufw ("The reason ufw was developed is that we wanted to create a server-level firewalling utility that was a little bit more for `human beings`"), which was to be simpler. Now, on the graphical side of things, Firestarer already existed. But why not make an even easier to use GUI for desktop `human beings`, powered by ufw? This is where Gufw comes in. RUN
You can run Gufw in GNOME menu: /System/Administration/Firewall configuration USAGE
BASIC SETTINGS
Gufw has two states: Enabled and disabled. When Gufw is enabled, you can allow/reject/deny all incoming and outgoing connections. ADD PRECONFIGURED RULE(S) You can select between more Programs and Services preconfigured. Once Program/Service can have multiples rules. ADD SIMPLE RULE(S) You can specify the port or service, and protocol to be allowed (allow traffic), reject (reject traffic without reply), denied (deny traf- fic with reply), limit (limit traffic) on the host, or limit an IP or Port (Protecting against brute-force login attacks). The port can be a number of 5 digits, from 1 to 65535. The service can be any of /etc/services file (By example tcpmux, echo, discard, systat...). The protocol can be: 1. TCP: Apply rule for all traffic in protocol TCP. 2. UDP: Apply rule for all traffic in protocol UDP. 3. both: Apply rule for all traffic in protocol TCP and UDP. ADD ADVANCED RULE(S) You can add an advanced rule. You can specify: 1. Protocol: TCP, UDP or both. 2. From IP Addres: You can allow/deny/reject/limit traffic from IP address. Example for a range: 192.168.1.0/9 3. From Port: You can allow/deny/reject/limit traffic from a port. This parameter is optional. The port can be a number of 5 digits, from 1 to 65535. You can use a range ports with this format port1:port2 (by example 3234:3237), or add multiple ports with port1,port2 (by example 3234,3254). 4. To IP Addres: You can allow/deny/limit traffic to an IP address. This parameter is optional. Example for a range: 192.168.1.0/9 5. To Port: You can allow/deny/reject/limit traffic to a Port. This parameter is optional. The port can be a number of 5 digits, from 1 to 65535. You can use a range ports with this format port1:port2 (by example 3234:3237). GENERAL TO PRECONFIGURED
/ SIMPLE / ADVANCED With the extended parameters you can: 1. Insert a rule in a specific row. 2. Set the log level for ufw. REMOVE ONE RULE
Steps: 1. Select a rule in the list. 2. Click in Remove button. You can delete more rules if you select it. RESET CONFIGURATION
You will remove all rules and reset the ufw configuration to intial status (disable)! EDIT PREFERENCES
You can edit your preferences in /Edit/Preferences menu. Preferences: 1. Gufw log: Gufw will register all commands sent to ufw. 2. ufw log: Enable/disable and set the level of the ufw log. 3. Listening Report: Will display the ports on the live system in the listening state for TCP and the open state for UDP. 4. Notification popups: Gufw will notify the new connections in the Listening Report. SEE ALSO
ufw(8) AUTHOR
Gufw is (C) 2008-2011, Marcos Alvarez Costales <https://launchpad.net/~costales>. This manual page was originally written by Marcos Alvarez Costales <https://launchpad.net/~costales>. 13 Feb 2011 gufw(8)
All times are GMT -4. The time now is 03:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy