Sponsored Content
Top Forums Shell Programming and Scripting Remove duplicate based on Group Post 302610773 by agama on Wednesday 21st of March 2012 07:55:55 PM
Old 03-21-2012
This should work:

Code:
awk -F "|" ' ! s[$1,$5]++ ' input-file >output-file


Last edited by agama; 03-21-2012 at 08:58 PM.. Reason: shrinkage :)
This User Gave Thanks to agama For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Remove duplicate rows of a file based on a value of a column

Hi, I am processing a file and would like to delete duplicate records as indicated by one of its column. e.g. COL1 COL2 COL3 A 1234 1234 B 3k32 2322 C Xk32 TTT A NEW XX22 B 3k32 ... (7 Replies)
Discussion started by: risk_sly
7 Replies

2. Shell Programming and Scripting

Remove duplicate files based on text string?

Hi I have been struggling with a script for removing duplicate messages from a shared mailbox. I would like to search for duplicate messages based on the “Message-ID” string within the messages files. I have managed to find the duplicate “Message-ID” strings and (if I would like) delete... (1 Reply)
Discussion started by: spangberg
1 Replies

3. UNIX for Dummies Questions & Answers

How to get remove duplicate of a file based on many conditions

Hii Friends.. I have a huge set of data stored in a file.Which is as shown below a.dat: RAO 1869 12 19 0 0 0.00 17.9000 82.3000 10.0 0 0.00 0 3.70 0.00 0.00 0 0.00 3.70 4 NULL LEE 1870 4 11 1 0 0.00 30.0000 99.0000 0.0 0 0.00 0 0.00 0.00 0.00 0 ... (3 Replies)
Discussion started by: reva
3 Replies

4. UNIX for Dummies Questions & Answers

Remove duplicate rows when >10 based on single column value

Hello, I'm trying to delete duplicates when there are more than 10 duplicates, based on the value of the first column. e.g. a 1 a 2 a 3 b 1 c 1 gives b 1 c 1 but requires 11 duplicates before it deletes. Thanks for the help Video tutorial on how to use code tags in The UNIX... (11 Replies)
Discussion started by: informaticist
11 Replies

5. Shell Programming and Scripting

Remove duplicate lines based on field and sort

I have a csv file that I would like to remove duplicate lines based on field 1 and sort. I don't care about any of the other fields but I still wanna keep there data intact. I was thinking I could do something like this but I have no idea how to print the full line with this. Please show any method... (8 Replies)
Discussion started by: cokedude
8 Replies

6. Shell Programming and Scripting

Remove duplicate value based on two field $4 and $5

Hi All, i have input file like below... CA009156;20091003;M;AWBKCA72;123;;CANADIAN WESTERN BANK;EDMONTON;;2300, 10303, JASPER AVENUE;;T5J 3X6;; CA009156;20091003;M;AWBKCA72;321;;CANADIAN WESTERN BANK;EDMONTON;;2300, 10303, JASPER AVENUE;;T5J 3X6;; CA009156;20091003;M;AWBKCA72;231;;CANADIAN... (2 Replies)
Discussion started by: mohan sharma
2 Replies

7. Shell Programming and Scripting

How To Remove Duplicate Based on the Value?

Hi , Some time i got duplicated value in my files , bundle_identifier= B Sometext=ABC bundle_identifier= A bundle_unit=500 Sometext123=ABCD bundle_unit=400 i need to check if there is a duplicated values or not if yes , i need to check if the value is A or B when Bundle_Identified ,... (2 Replies)
Discussion started by: OTNA
2 Replies

8. Shell Programming and Scripting

Remove duplicate entries based on the range

I have file like this: chr start end chr15 99874874 99875874 chr15 99875173 99876173 aa1 chr15 99874923 99875923 chr15 99875173 99876173 aa1 chr15 99874962 99875962 chr15 99875173 99876173 aa1 chr1 ... (7 Replies)
Discussion started by: raj_k
7 Replies

9. Shell Programming and Scripting

Remove duplicate rows based on one column

Dear members, I need to filter a file based on the 8th column (that is id), and does not mather the other columns, because I want just one id (1 line of each id) and remove the duplicates lines based on this id (8th column), and does not matter wich duplicate will be removed. example of my file... (3 Replies)
Discussion started by: clarissab
3 Replies

10. Shell Programming and Scripting

Remove sections based on duplicate first line

Hi, I have a file with many sections in it. Each section is separated by a blank line. The first line of each section would determine if the section is duplicate or not. if the section is duplicate then remove the entire section from the file. below is the example of input and output.... (5 Replies)
Discussion started by: ahmedwaseem2000
5 Replies
WVDIAL.CONF(5)							File Formats Manual						    WVDIAL.CONF(5)

NAME
wvdial.conf - wvdial configuration file DESCRIPTION
When wvdial starts, it first loads its configuration from /etc/wvdial.conf, which contains basic information about the modem port, speed, and init string, along with information about your Internet Service Provider (ISP), such as the phone number, your username, and your pass- word. The configuration file /etc/wvdial.conf is in Windows "ini" file format, with sections named in square brackets and a number of variable = value pairs within each section. Here is a sample configuration file: [Dialer Defaults] Modem = /dev/ttyS2 Baud = 57600 Init = ATZ Init2 = AT S11=50 Phone = 555-4242 Username = apenwarr Password = my-password [Dialer phone2] Phone = 555-4243 [Dialer shh] Init3 = ATM0 [Dialer pulse] Dial Command = ATDP The sample configuration file above contains all of the options necessary to run the two sample command lines given above. Here is a com- plete list of settings that wvdial understands: Modem The location of the device that wvdial should use as your modem. The default is /dev/modem. Baud The speed at which wvdial will communicate with your modem. The default is 57600 baud. Init1 ... Init9 wvdial can use up to nine initialization strings to set up your modem. Before dialing, these strings are sent to the modem in numerical order. These are particularly useful when specifying multiple sections. See above for an example that uses Init3 to turn the modem's speaker off. The default is "ATZ" for Init1. Phone The phone number you want wvdial to dial. You can add up to 4 other phone numbers that wvdial will dial in order, by adding: Phone1 Phone2 Phone3 Phone4 Dial Prefix wvdial will insert this string after the dial command and before the phone number. For example, to disable call waiting (in North America, anyway) set this to "*70,". Dial Command wvdial will use this string to tell the modem to dial. The default is "ATDT". Login You must set this to the username you use at your ISP. Login Prompt If your ISP has an unusual login procedure that wvdial is unable to figure out, you can use this option to specify a login prompt. When this prompt is received from your ISP, wvdial will send the Login string. Password You must set this to the password you use at your ISP. Ask Password By setting this option wvdial will prompt for your password on every dialin. Thus you don't have to save your password in /etc/wvdial.conf. (Option added by SuSE.) Password Prompt If your ISP has an unusual login procedure that wvdial is unable to figure out, you can use this option to specify a password prompt. When this prompt is received from you ISP, wvdial will send the Password string. PPPD Path If your system has pppd somewhere other than /usr/sbin/pppd, you will need to set this option. Auto DNS Try to get the Domain Nameserver (DNS) from the provider. This option is "on" by default. (Option added by SuSE.) Check DNS Check the Domain Nameserver (DNS) after the connection has been set up. This option is "on" by default. (Option added by SuSE.) DNS Test1 First DNS lookup for DNS check. (Option added by SuSE.) DNS Test2 Second DNS lookup for DNS check. (Option added by SuSE.) Check Def Route Check the default route after the connection has been set up. This option is "on" by default. (Option added by SuSE.) Force Address This option only applies if you have a static IP address at your ISP, and even then you probably don't need it. Some ISP's don't send the IP address as part of the PPP negotiation. This option forces pppd to use the address you give it. Remote Name If your ISP uses PAP or CHAP authentication, you might need to change this to your ISP's authentication name. In most cases, how- ever, it's safe to use the default value, "*". Carrier Check wvdial checks your modem during the connection process to ensure that it is actually online. If you have a weird modem that insists its carrier line is always down, you can disable the carrier check by setting this option to "no". Stupid Mode When wvdial is in Stupid Mode, it does not attempt to interpret any prompts from the terminal server. It starts pppd immediately after the modem connects. Apparently there are ISP's that actually give you a login prompt, but work only if you start PPP, rather than logging in. Go figure. Stupid Mode is (naturally) disabled by default. New PPPD You need this option if you have pppd version 2.3.0 or newer, to make wvdial create the file /etc/ppp/peers/wvdial. This option is enabled by default, thus if you have older pppd you need to set it to `no' (or upgrade pppd). Default Reply When wvdial detects a prompt, and it hasn't seen any clues that indicate what it should send as a response to the prompt, it defaults to sending "ppp". Sometimes this is inadequate. Use this option to override wvdial's default prompt response. Auto Reconnect If enabled, wvdial will attempt to automatically reestablish a connection if you are randomly disconnected by the other side. This option is "on" by default. Idle Seconds Set the hangup timeout in seconds. If there is inactivity for the given time the connection is shut down. A hangup timeout of 0 disables this feature. Abort on Busy If enabled, wvdial will not retry the connection if the modem says that the line is busy. This option is "off" by default. Abort on No Dialtone If enabled, wvdial will not retry the connection if the modem says that there is no dialtone. This option is "on" by default. Dial Attempts If value is set, wvdial will quit after that many tries .If set to 0, wvdial will happily keep dialling forever. The wvdialconf(1) program can be used to detect your modem and fill in the Modem, Baud, and Init/Init2 options automatically. AUTHORS
Dave Coombs and Avery Pennarun for Net Integration Technologies Inc. Great contributions have been made by many people, including SuSE and RedHat. Thanks guys! SEE ALSO
wvdial(1), wvdialconf(1), pppd(8). WvDial December 2005 WVDIAL.CONF(5)
All times are GMT -4. The time now is 10:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy