Sponsored Content
Full Discussion: Total of columns
Top Forums Shell Programming and Scripting Total of columns Post 302589843 by greycells on Thursday 12th of January 2012 10:04:43 PM
Old 01-12-2012
Total of columns

Input file

Code:
 
cll_0014_spp,84,uranus,disk33,45
 
cll_0014_spp,84,pluto,disk3,10
cll_0014_spp,450,pluto,disk4,1
cll_0014_spp,453,pluto,disk46,19
 
cll_0014_spp,84,neptune,disk34,60
cll_0014_spp,450,neptune,disk4,1
cll_0014_spp,68,neptune,disk54,59
 
cll_1234_spp,66,satrun,1000
cll_1234_spp,28,satrun,1024
cll_1234_spp,49,satrun,786
 
cll_3456_spp,1614,pluto,58
cll_3456_spp,1656,pluto,120


Output needed

Code:
cll_0014_spp,uranus,45
cll_0014_spp,pluto,11
cll_0014_spp,neptune,119
cll_1234_spp,satrun,2810
cll_1234_spp,pluto,178

Basically i need to total up column 5 based on unique combination sets of (column 1 and 3)

Thanks

Last edited by greycells; 01-13-2012 at 09:01 AM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grep running total/ final total across multiple files

Ok, another fun hiccup in my UNIX learning curve. I am trying to count the number of occurrences of an IP address across multiple files named example.hits. I can extract the number of occurrences from the files individually but when you use grep -c with multiple files you get the output similar to... (5 Replies)
Discussion started by: MrAd
5 Replies

2. Shell Programming and Scripting

Calculate total space, total used space and total free space in filesystem names matching keyword

Good afternoon! Im new at scripting and Im trying to write a script to calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
Discussion started by: bigben1220
4 Replies

3. Shell Programming and Scripting

Single command for add 2 columns and remove 2 columns in unix/performance tuning

Hi all, I have created a script which adding two columns and removing two columns for all files. Filename: Cust_information_1200_201010.txt Source Data: "1","Cust information","123","106001","street","1-203 high street" "1","Cust information","124","105001","street","1-203 high street" ... (0 Replies)
Discussion started by: onesuri
0 Replies

4. Shell Programming and Scripting

Help with sum total number of record and total number of record problem asking

Input file SFSQW 5192.56 HNRNPK 611.486 QEQW 1202.15 ASDR 568.627 QWET 6382.11 SFSQW 4386.3 HNRNPK 100 SFSQW 500 Desired output file SFSQW 10078.86 3 QWET 6382.11 1 QEQW 1202.15 1 HNRNPK 711.49 2 ASDR 568.63 1 The way I tried: (2 Replies)
Discussion started by: patrick87
2 Replies

5. Shell Programming and Scripting

Combine columns from many files but keep them aligned in columns-shorter left column issue

Hello everyone, I searched the forum looking for answers to this but I could not pinpoint exactly what I need as I keep having trouble. I have many files each having two columns and hundreds of rows. first column is a string (can have many words) and the second column is a number.The files are... (5 Replies)
Discussion started by: isildur1234
5 Replies

6. Shell Programming and Scripting

Deleting all the fields(columns) from a .csv file if all rows in that columns are blanks

Hi Friends, I have come across some files where some of the columns don not have data. Key, Data1,Data2,Data3,Data4,Data5 A,5,6,,10,, A,3,4,,3,, B,1,,4,5,, B,2,,3,4,, If we see the above data on Data5 column do not have any row got filled. So remove only that column(Here Data5) and... (4 Replies)
Discussion started by: ks_reddy
4 Replies

7. Shell Programming and Scripting

Compare 2 csv files by columns, then extract certain columns of matcing rows

Hi all, I'm pretty much a newbie to UNIX. I would appreciate any help with UNIX coding on comparing two large csv files (greater than 10 GB in size), and output a file with matching columns. I want to compare file1 and file2 by 'id' and 'chain' columns, then extract exact matching rows'... (5 Replies)
Discussion started by: bkane3
5 Replies

8. Shell Programming and Scripting

Sub TOTAL Columns

Input 435,BL_lmapm03,rrr,RDF1+TDEV,0cef,45,mask1 435,BL_lmapm03,rrr,TDEV,080a,50,mask2 435,BL_lmapm02,fff,RDF1+TDEV,0ceg,45,mask4 435,BL_lmapm02,fff,TDEV,080b,60,mask6 435,BL_lmapm06,hhh,TDEV,080f,60,mask9 Output 435,BL_lmapm03,rrr,RDF1+TDEV,0cef,45,mask1... (4 Replies)
Discussion started by: greycells
4 Replies

9. Shell Programming and Scripting

Evaluate 2 columns, add sum IF two columns satisfy the condition

HI All, I'm embedding SQL query in Script which gives following output: Assignee Group Total ABC Group1 17 PQR Group2 5 PQR Group3 6 XYZ Group1 10 XYZ Group3 5 I have saved the above output in a file. How do i sum up the contents of this output so as to get following output: ... (4 Replies)
Discussion started by: Khushbu
4 Replies
IPSEC_AUTO(8)							  [FIXME: manual]						     IPSEC_AUTO(8)

NAME
ipsec_auto - control automatically-keyed IPsec connections SYNOPSIS
ipsec auto [--show] [--showonly] [--asynchronous] [--config configfile] [--verbose] operation connection ipsec auto [--show] [--showonly] [--asynchronous] [--config configfile] [--verbose] operation connection EXAMPLES
ipsec auto { --add | --delete | --replace | --up | --down } connection ipsec auto { --status | --ready } connection ipsec auto { --route | --unroute } connection ipsec auto [--utc] [--listall | --rereadall] [--rereadsecrets] [--listcerts] [--listpubkeys] [--checkpubkeys] [--listcacerts | --rereadcacerts] [--listcrls | --rereadcrls] [[--listocspcerts | --rereadocspcerts ] [--listocsp | --purgeocsp ]] [--listacerts | --rereadacerts] [--listaacerts | --rereadaacerts] [--listgroups | --rereadgroups] DESCRIPTION
Auto manipulates automatically-keyed Openswan IPsec connections, setting them up and shutting them down based on the information in the IPsec configuration file. In the normal usage, connection is the name of a connection specification in the configuration file; operation is --add, --delete, --replace, --up, --down, --route, or --unroute. The --ready, --rereadsecrets, --rereadgroups, and --status operations do not take a connection name. Auto generates suitable commands and feeds them to a shell for execution. The --add operation adds a connection specification to the internal database within pluto; it will fail if pluto already has a specification by that name. The --delete operation deletes a connection specification from pluto's internal database (also tearing down any connections based on it); it will fail if the specification does not exist. The --replace operation is equivalent to --delete (if there is already a specification by the given name) followed by --add, and is a convenience for updating pluto's internal specification to match an external one. (Note that a --rereadsecrets may also be needed.) The --rereadgroups operation causes any changes to the policy group files to take effect (this is currently a synonym for --ready, but that may change). None of the other operations alters the internal database. The --up operation asks pluto to establish a connection based on an entry in its internal database. The --down operation tells pluto to tear down such a connection. Normally, pluto establishes a route to the destination specified for a connection as part of the --up operation. However, the route and only the route can be established with the --route operation. Until and unless an actual connection is established, this discards any packets sent there, which may be preferable to having them sent elsewhere based on a more general route (e.g., a default route). Normally, pluto's route to a destination remains in place when a --down operation is used to take the connection down (or if connection setup, or later automatic rekeying, fails). This permits establishing a new connection (perhaps using a different specification; the route is altered as necessary) without having a "window" in which packets might go elsewhere based on a more general route. Such a route can be removed using the --unroute operation (and is implicitly removed by --delete). The --ready operation tells pluto to listen for connection-setup requests from other hosts. Doing an --up operation before doing --ready on both ends is futile and will not work, although this is now automated as part of IPsec startup and should not normally be an issue. The --status operation asks pluto for current connection status. The output format is ad-hoc and likely to change. The --rereadsecrets operation tells pluto to re-read the /etc/ipsec.secrets secret-keys file, which it normally reads only at startup time. (This is currently a synonym for --ready, but that may change.) The --rereadsecrets operation tells pluto to re-read the /etc/ipsec.secrets secret-keys file, which it normally reads only at startup time. (This is currently a synonym for --ready, but that may change.) The --rereadcacerts operation reads all certificate files contained in the /etc/ipsec.d/cacerts directory and adds them to plutoas list of Certification Authority (CA) certificates. The --rereadaacerts operation reads all certificate files contained in the /etc/ipsec.d/aacerts directory and adds them to plutoas list of Authorization Authority (AA) certificates. The --rereadocspcerts operation reads all certificate files contained in the /etc/ipsec.d/ocspcerts directory and adds them to plutoas list of OCSP signer certificates. The --rereadacerts operation reads all certificate files contained in the /etc/ipsec.d/acerts directory and adds them to plutoas list of attribute certificates. The --rereadcrls operation reads all certificate revocation list (CRL) files contained in the /etc/ipsec.d/crls directory and adds them to plutoas list of CRLs. The --rereadall operation is equivalent to the execution of --rereadse- crets, --rereadcacerts, --rereadaacerts, --rereadocspcerts, --rereadac- erts, and --rereadcrls. The --listpubkeys operation lists all RSA public keys either received from peers via the IKE protocol embedded in authenticated certificate payloads or loaded locally using the rightcert / leftcert or rightr- sasigkey / leftrsasigkey parameters in ipsec.conf(5). The --listcerts operation lists all X.509 certificates loaded locally using the rightcert and leftcert parameters in ipsec.conf(5). The --checkpubkeys operation lists all loaded X.509 certificates which are about to expire or have been expired. The --listcacerts operation lists all X.509 CA certificates either loaded locally from the /etc/ipsec.d/cacerts directory or received in PKCS#7-wrapped certificate payloads via the IKE protocol. The --listaacerts operation lists all X.509 AA certificates loaded locally from the /etc/ipsec.d/aacerts directory. The --listocspcerts operation lists all OCSP signer certificates either loaded locally from the /etc/ipsec.d/ocspcerts directory or received via the Online Certificate Status Protocol from an OCSP server. The --listacerts operation lists all X.509 attribute certificates loaded locally from the /etc/ipsec.d/acerts directory. The --listgropus operation lists all groups that are either used in connection definitions in ipsec.conf(5) or are embedded in loaded X.509 attributes certificates. The --listcainfos operation lists the certification authority informa- tion specified in the ca sections of ipsec.conf(5). The --listcrls operation lists all Certificate Revocation Lists (CRLs) either loaded locally from the /etc/ipsec.d/crls directory or fetched dynamically from an HTTP or LDAP server. The --listocsp operation lists the certicates status information fetched from OCSP servers. The --purgeocsp operation deletes any cached certificate status infor- mation and pending OCSP fetch requests. The --listall operation is equivalent to the execution of --listpubkeys, --listcerts, --listcacerts, --listaacerts, --listoc- spcerts, --listacerts, --listgroups, --listcainfos, --listcrls, --lis- tocsp. The --showonly option causes auto to show the commands it would run, on standard output, and not run them. The --asynchronous option, applicable only to the up operation, tells pluto to attempt to establish the connection, but does not delay to report results. This is especially useful to start multiple connections in parallel when network links are slow. The --verbose option instructs auto to pass through all output from ipsec_whack(8), including log output that is normally filtered out as uninteresting. The --show option turns on the -x option of the shell used to execute the commands, so each command is shown as it is executed. The --config option specifies a non-standard location for the IPsec configuration file (default /etc/ipsec.conf). See ipsec.conf(5) for details of the configuration file. FILES
/etc/ipsec.conf default IPSEC configuration file /etc/ipsec.d/ X.509 and Opportunistic Encryption files /var/run/pluto/ipsec.info %defaultroute information /var/run/pluto/pluto.ctl Pluto command socket SEE ALSO
ipsec.conf(5), ipsec(8), ipsec_pluto(8), ipsec_whack(8), ipsec_manual(8) HISTORY
Originally written for the FreeS/WAN project <http://www.freeswan.org> by Henry Spencer. BUGS
Although an --up operation does connection setup on both ends, --down tears only one end of the connection down (although the orphaned end will eventually time out). There is no support for passthrough connections. A connection description which uses %defaultroute for one of its nexthop parameters but not the other may be falsely rejected as erroneous in some circumstances. The exit status of --showonly does not always reflect errors discovered during processing of the request. (This is fine for human inspection, but not so good for use in scripts.) [FIXME: source] 07/25/2011 IPSEC_AUTO(8)
All times are GMT -4. The time now is 06:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy