Sponsored Content
Top Forums Shell Programming and Scripting Display combination of 4 field uniqe record and along with concatenate 5th and 6th field. Post 302959348 by udhal on Sunday 1st of November 2015 10:44:50 AM
Old 11-01-2015
Hi Don,

If 2 extra fields $7(SUM1) and $8(SUM2) is there how can we will
Display combination of 4 field unique record and along with concatenate 5th and 6th field and summations of 7 and 8 fields

Code:
Table
---
ACN|NAME|CITY|CTY|NO1|NO2|SUM1|SUM2
115|AKKK|ASH|IND|10|15|20|10
115|AKKK|ASH|IND|20|20|40|50
115|AKKK|ASH|IND|30|35|45|35
115|AKKK|ASH|IND|30|35|25|25
112|ABC|FL|USA|15|15|45|25
112|ABC|FL|USA|25|20|45|25
112|ABC|FL|USA|25|45|25|35

Code:
Output-----
115|AKKK|ASH|IND|10|20|30|30|15|20|35|35|130|120
112|ABC|FL|USA|15|25|25|15|20|45|115|85

Appreciate your replay
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Retrieve 5th Field to Last Field !!

I have a script which retrieves certain fields from a text file using awk. The delimiter used is white space. cat /home/eis/boss/OPS|while read LINE do crdno=`echo $LINE | awk '{print $1}'` atm=`echo $LINE | awk '{print $2}'` seq=`echo $LINE | awk '{print $3}'` amount=`echo $LINE | awk... (3 Replies)
Discussion started by: jobbyjoseph
3 Replies

2. Shell Programming and Scripting

get a field from a record

I have a file as: A,B,C,D,E G,H,I,J,K I need to find if fourth field is blank or has a space and print that line to other file. I tried using awk but am not getting the desired result. Pls help. (6 Replies)
Discussion started by: praveenK_Dudala
6 Replies

3. Shell Programming and Scripting

Get 4 character each from 2 different fields concatenate and add as a new field

Hi, I have a huge text file. It looks like abcde bangalo country 12345 lastfield i want to get first 3 characters from field1 and first 3 characters from field 2 and insert the result as a new field. example the result should be: abcde bangalo abcban country 12345 lastfield Please... (4 Replies)
Discussion started by: ajithshankar@ho
4 Replies

4. Shell Programming and Scripting

concatenate consecutive field values

Hi, I have a file like this A Bob A Sam A John B David C Paul C Sandra If the consecutive field values in column one is same, then concatenate the corresponding strings. So, I need an output like this, A Bob_Sam_John B David C Paul_Sandra I usually work with excel but... (3 Replies)
Discussion started by: polsum
3 Replies

5. Shell Programming and Scripting

Get last field specific record

i have file A as below contents --------------------------- Use descriptive thread titles when posting. For example, do not post questions with subjects like "Help Me!", "Urgent!!" or "Doubt". For example, do not post questions For example, do not deliminated. output file as below:... (2 Replies)
Discussion started by: ANSHUMAN1983
2 Replies

6. Shell Programming and Scripting

Concatenate last field values for all occurences

Hello all, Maybe you can help me with an awk script to get what I need. I have the input file with format below: REQUEST|79023787741690|738227864597|985 REQUEST|79024002151717|738229423534|985 REQUEST|79024002151717|738229423534|*985 NDS-REQUEST|79024002151717|738229423534 ... (4 Replies)
Discussion started by: Ophiuchus
4 Replies

7. UNIX for Dummies Questions & Answers

How to sort the 6th field of tab delimited files?

Here's a sample of the data: NAME BIRTHDAY SEX LOCATION AGE ID Jim 05/11/1986 M Japan 27 86 Rei 08/25/1990 F Korea 24 33 Jane 02/24/1985 F India 29 78 I've been trying to sort files using the... (8 Replies)
Discussion started by: maihani
8 Replies

8. Shell Programming and Scripting

How to remove alphabets/special characters/space in the 5th field of a tab delimited file?

Thank you for 4 looking this post. We have a tab delimited file where we are facing problem in a lot of funny character. I have tried using awk but failed that is not working. In the 5th field ID which is supposed to be a integer only of that file, we are getting corrupted data as below. I... (12 Replies)
Discussion started by: Srithar
12 Replies

9. Shell Programming and Scripting

Trying to get 5th field from ls -l output

Bash Shell/Oracle Linux 6.4 Following is an ls -lh output. Files which are equal to or higher than 1Gigabytes will displayed with G in the 5th column of the output. I am trying to find all files which are equal to or higher than 1G File sizes are shown in the 5th column. So, I tried cut -d'... (7 Replies)
Discussion started by: John K
7 Replies

10. UNIX for Dummies Questions & Answers

Display latest record from file based on multiple columns combination

I have requirement to print latest record from file based on multiple columns combination. EWAPE EW1SLE0000 EW1SOMU01 ABORTED 03/16/2015 100004 03/16/2015 100005 001 EWAPE EW1SLE0000 EW1SOMU01 ABORTED 03/18/2015 140003 03/18/2015 140004 001 EWAPE EW1SLE0000 EW1SOMU01 ABORTED 03/18/2015 220006... (1 Reply)
Discussion started by: tmalik79
1 Replies
SLAPO-RETCODE(5)						File Formats Manual						  SLAPO-RETCODE(5)

NAME
slapo-retcode - return code overlay to slapd SYNOPSIS
/etc/ldap/slapd.conf DESCRIPTION
The retcode overlay to slapd(8) is useful to test the behavior of clients when server-generated erroneous and/or unusual responses occur, e.g. error codes, referrals, excessive response times and so on. The error responses are generated according to different strategies. In the first case, all operations targeted at a specific configurable subtree cause the object related to the request DN to be looked up and checked for return code data: a response code, plus an optional textual message, an optional configurable delay, an optional matched DN field, and, when the response code is "referral", a (list of) referral(s). Well-known response codes from standard track documents are provided in retcode.conf, which can be included after instantiating the over- lay. In the second case, objects of classes inherited from the errAbsObject, like errObject or errAuxObject, when returned as intermediate responses of a search request, are changed into the response dictated by their content. A third mode causes objects to be looked up from the underlying database to discover if their class inherits from errABsObject; in that case, their content is used to compute the corresponding response. The behavior is disabled by using the manageDSAit control (RFC 3296); in that case, the resulting object, either present in the directory or dynamically generated by the overlay, or contained in the request, is handled as usual. The config directives that are specific to the retcode overlay must be prefixed by retcode-, to avoid conflicts with directives specific to the underlying database or to other stacked overlays. The following specific directives can be used to configure the retcode overlay: retcode-parent <DN> This directive defines the parent DN where dynamically generated entries reside. If not defined, the suffix of the database is used. retcode-item <RDN> <errCode> [op=<oplist>] [text=<message>] [ref=<referral>] [sleeptime=<sec>] [matched=<DN>] [unsolicited=<OID>[:<data>]] [flags=[{pre|post}-]disconnect[,...]] A dynamically generated entry, located below retcode-parent. The errCode is the number of the response code; it can be in any format supported by strtol(3). The optional oplist is a list of operations that cause response code generation; if absent, all operations are affected. The matched field is the matched DN that is returned along with the error, while the text field is an optional diagnostics message. The ref field is only allowed for the referral response code. The sleeptime field causes slapd(8) to sleep the specified number of seconds before proceeding with the operation. The unsolicited field can be used to cause the return of an RFC 4511 unsolicited response message; if OID is not "0", an extended response is generated, with the optional data appended. If flags contains disconnect, or pre-disconnect, slapd(8) disconnects abruptly, without notice; post-disconnect causes disconnection right after sending response as appropriate. retcode-indir Enables exploitation of in-directory stored errAbsObject. May result in a lot of unnecessary overhead. retcode-sleep [-]<n> Defines a sleep time in seconds that is spent before actually handling any operation. If negative, a random time between 0 and the absolute value of the argument is used. SCHEMA
The retcode overlay utilizes the "return code" schema described herein. This schema is specifically designed for use with this overlay and is not intended to be used otherwise. It is also noted that the schema described here is a work in progress, and hence subject to change without notice. The schema is loaded automatically by the overlay. The schema includes a number of object classes and associated attribute types as described below. The error code: ( 1.3.6.1.4.1.4203.666.11.4.1.1 NAME ( 'errCode' ) DESC 'LDAP error code' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) The operations that trigger the response code: ( 1.3.6.1.4.1.4203.666.11.4.1.2 NAME ( 'errOp' ) DESC 'Operations the errObject applies to' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) The text message: ( 1.3.6.1.4.1.4203.666.11.4.1.3 NAME ( 'errText' ) DESC 'LDAP error textual description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) The sleep time before the response is actually returned to the client: ( 1.3.6.1.4.1.4203.666.11.4.1.4 NAME ( 'errSleepTime' ) DESC 'Time to wait before returning the error' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) The matched DN returned to the client: ( 1.3.6.1.4.1.4203.666.11.4.1.5 NAME ( 'errMatchedDN' ) DESC 'Value to be returned as matched DN' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE ) The OID to be returned as extended response OID in RFC 4511 unsolicited responses ("0" generates a regular response with msgid set to 0): ( 1.3.6.1.4.1.4203.666.11.4.1.6 NAME ( 'errUnsolicitedOID' ) DESC 'OID to be returned within unsolicited response' EQUALITY objectIdentifierMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 SINGLE-VALUE ) The octet string to be returned as extended response data in RFC 4511 unsolicited response: ( 1.3.6.1.4.1.4203.666.11.4.1.7 NAME ( 'errUnsolicitedData' ) DESC 'Data to be returned within unsolicited response' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE ) If TRUE, slapd(8) disconnects abruptly without notice; if FALSE, it disconnects after sending response as appropriate: ( 1.3.6.1.4.1.4203.666.11.4.1.8 NAME ( 'errDisconnect' ) DESC 'Disconnect without notice' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE ) The abstract class that triggers the overlay: ( 1.3.6.1.4.1.4203.666.11.4.3.0 NAME ( 'errAbsObject' ) SUP top ABSTRACT MUST ( errCode ) MAY ( cn $ description $ errOp $ errText $ errSleepTime $ errMatchedDN ) ) The standalone structural objectclass for specifically created data: ( 1.3.6.1.4.1.4203.666.11.4.3.1 NAME ( 'errObject' ) SUP errAbsObject STRUCTURAL ) The auxiliary objectclass to alter the behavior of existing objects: ( 1.3.6.1.4.1.4203.666.11.4.3.2 NAME ( 'errAuxObject' ) SUP errAbsObject AUXILIARY ) EXAMPLE
overlay retcode retcode-parent "ou=RetCodes,dc=example,dc=com" # retcode.conf is found in tests/data/ of the source tree include ./retcode.conf # Wait 10 seconds, then return success (0x00) retcode-item "cn=Success after 10 seconds" 0x00 sleeptime=10 # Wait 10 seconds, then return timelimitExceeded (0x03) retcode-item "cn=Timelimit after 10 seconds" 0x03 sleeptime=10 FILES
/etc/ldap/slapd.conf default slapd configuration file SEE ALSO
slapd.conf(5), slapd-config(5), slapd(8). The slapo-retcode(5) overlay supports dynamic configuration via back-config. ACKNOWLEDGEMENTS
This module was written in 2005 by Pierangelo Masarati for SysNet s.n.c. OpenLDAP 2012/04/23 SLAPO-RETCODE(5)
All times are GMT -4. The time now is 10:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy