06-09-2009
verifying column2 for same kind of records and adding corresponding values in column3
Hi
am having a file which looks like this
Quote:
07-Jun-2009 919448010059 54 lessrv1
07-Jun-2009 919449829088 52 lessrv1
07-Jun-2009 919449829088 48 lessrv6
07-Jun-2009 919447446632 57 lessrv1
07-Jun-2009 919449011866 61 lessrv1
07-Jun-2009 919447001101 40 lessrv1
07-Jun-2009 919448010062 51 lessrv1
07-Jun-2009 919448010062 58 lessrv7
07-Jun-2009 919448010151 61 lessrv1
07-Jun-2009 919490123007 56 lessrv1
07-Jun-2009 919448010151 39 lessrv4
07-Jun-2009 919448010062 41 lessrv3
i want to get unique values in column2 and sum up the corresponding column3 values and discard the column4 and then write the output in different file.
i.e the output has to be like
Quote:
07-Jun-2009 919448010059 54
07-Jun-2009 919449829088 100
07-Jun-2009 919447446632 57
07-Jun-2009 919449011866 61
07-Jun-2009 919447001101 40
07-Jun-2009 919448010062 150
07-Jun-2009 919448010151 100
07-Jun-2009 919490123007 56
i.e
07-Jun-2009 919449829088 52 lessrv1
07-Jun-2009 919449829088 48 lessrv6
leads to
07-Jun-2009 919449829088 100
thanks in advance
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Does anybody know who I can set up SPR records? I've created a record and it says that I need to and
I logged into the server as the root users via ssh and typed in /var/named (which my host told me to do) but all it said was
I really need to add this because Microsoft is blocking emails... (11 Replies)
Discussion started by: thehaapyappy
11 Replies
2. Shell Programming and Scripting
I have the following script in a shell
# The start of a filename
file=$(ls -tr $EMT*.dat | tail -1) # Select the latest file echo $file
file_seq=$( < /u02/sct/banner/bandev2/xxxxxx/misc/EFTSQL.dat)
echo $file_seq
file2 = '$file_seq + 1'
echo $file2
It is reading a file EFTSQL.dat... (3 Replies)
Discussion started by: rechever
3 Replies
3. Shell Programming and Scripting
Hi,
Script copies records of two tables into another tables for backup before using oracle's import utility to restore from backup.
Now, suppose if the import utility fails then the script will again copy those records from the backup table to the original ones.
How to check whether all... (2 Replies)
Discussion started by: milink
2 Replies
4. Shell Programming and Scripting
I have a file with 50,000 records in it, i have a requirement to use the same 50,000 records and add them 4 times to the same file to make a total of 200,000 records. I was wondering how to do this using ksh. Any help is greatly appreciated. (2 Replies)
Discussion started by: vpv0002
2 Replies
5. Shell Programming and Scripting
How can we a shell script and pass date parameters .I have 3 files comming from Datastage with |" delimited
I need append 3 files as above: File1:
P0000|"47416954|"AU|"000|"INS|"0000|"|"20060601|"99991231|"|"|"|"|"01
File 2:... (2 Replies)
Discussion started by: e1994264
2 Replies
6. Shell Programming and Scripting
Given a file like this:
abc
def
ghi
I need to get to
somestandardtext abc1 morestandardtext
somestandardtext def2 morestandardtext
somestandardtext ghi3 morestandardtext
Notice that in addition to the standard text there is the line number added in as well. What I conceived is... (4 Replies)
Discussion started by: edstevens
4 Replies
7. Shell Programming and Scripting
I'm using a shell script to manipulate a data file. I have a large file with two sets of data samples (tracking memory consumption) taken over a long period of time, so I have many samples. The problem is that all the data is in the same file so that each sample contains two sets of data.... (2 Replies)
Discussion started by: abercrom
2 Replies
8. UNIX for Dummies Questions & Answers
count occurrence of column3 in column2 with awk
Input:
AA BB
BB AA
BB CC
AA BB
CC AA
CC BB
CC CC
BB BB
Output:
AA BB 3 (1 Reply)
Discussion started by: aydj
1 Replies
9. Programming
Hi Guys,
I am having below tables in oracle
T1
ID F_TYPE F_AMT DATE_COL
1 F 6 11-Feb-16
1 D 2 11-Feb-16
1 D 2 11-Feb-16
1 F 6 11-Feb-16
1 F 2 12-Mar-16
1 D 3 12-Mar-16
1 F 4 10-Apr-16
1 F 4 11-Apr-16
1 D 1 11-Apr-16
T2
ID START_DATE END_DATE F_ID FLAG... (0 Replies)
Discussion started by: rohit_shinez
0 Replies
LEARN ABOUT DEBIAN
bitten-slave
BITTEN-SLAVE(1) User Commands BITTEN-SLAVE(1)
NAME
bitten-slave - Performs a build and sends result to the Bitten master.
SYNOPSIS
bitten-slave [--version] [-h] [--help] [--name=name] [-f file] [--config=file] [-u username] [--user=username] [-p password]
[--password=password] [-d dir] [--work-dir=dir] [--build-dir=build_dir] [-k] [--keep-files] [-s] [--single] [-n] [--dry-run]
[-i seconds] [--interval=seconds] [-l filename] [--log=filename] [-v] [--verbose] [-q] [--quiet] [--dump-reports] [URL] [URLs]
DESCRIPTION
bitten-slave performs a continuous integration build and reports the result back to the bitten-master. Run bitten-slave --help for details.
COPYRIGHT
Copyright 2009 W. Martin Borgert. Redistribution and use in source and binary forms, with or without modification, are permitted under the
terms of the BSD License.
AUTHOR
W. Martin Borgert
Author.
COPYRIGHT
Copyright (C) 2009 W. Martin Borgert
bitten-slave 2009-10-16 BITTEN-SLAVE(1)