Sponsored Content
Top Forums Shell Programming and Scripting Remove duplicate value based on two field $4 and $5 Post 302771585 by mohan sharma on Thursday 21st of February 2013 04:34:37 AM
Old 02-21-2013
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 WESTERN BANK;EDMONTON;;2300, 10303, JASPER AVENUE;;T5J 3X6;;
DE018774;20091003;M;;;29121731;OLDENBURGISCHE LANDESBANK AG;WEYHE B BREMEN;;;;28844;DE;
DE018202;20091003;M;;;26720028;OLDENBURGISCHE LANDESBANK AG;BAD BENTHEIM;;;;48444;DE;
DE018449;20091003;M;;;26520017;OLDENBURGISCHE LANDESBANK AG;MELLE, WIEHENGEB;;;;49303;DE;
CA009156;20091003;M;CWBKCA61;XXX;;CANADIAN WESTERN BANK;EDMONTON;;2300, 10303, JASPER AVENUE;;T5J 3X6;;
CA009156;20091003;M;CWBKCA61;XXX;;CANADIAN WESTERN BANK;EDMONTON;;2300, 10303, JASPER AVENUE;;T5J 3X6;;
CA009156;20091003;M;CWBKCA61;123;;CANADIAN WESTERN BANK;EDMONTON;;2300, 10303, JASPER AVENUE;;T5J 3X6;;

I want unique output based on $4 .
if different branch code is available for same BIC($4) code and one of the branch code($5) is XXX.only one row will be stored and with branch code as XXX .rest of the rows for the BIC code will not be stored.

here $4 is having 3 bic code with same value"CWBKCA61" with diff branch code in $5 and i want only one BIC code($4) with XXX value ...and if XXX is not present in $5 then i need all record..

condition is given is if among all the branch code ($5) for same BIC code($4) "XXX" is not present then i have to print as usual...duplicate value only remove when XXX is present in among all the Branch code for same Bic code...

and if null value is present in $4 and $5(ex->row 4,5,6) then i have to print as usual no need to remove that value..

please help me....

Last edited by mohan sharma; 02-21-2013 at 05:38 AM.. Reason: code tags...
 

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

Remove duplicate lines (the first matching line by field criteria)

Hello to all, I have this file 2002 1 23 0 0 2435.60 131.70 5.60 20.99 0.89 0.00 285.80 2303.90 2002 1 23 15 0 2436.60 132.90 6.45 21.19 1.03 0.00 285.80 2303.70 2002 1 23 ... (6 Replies)
Discussion started by: joggdial3000
6 Replies

3. Shell Programming and Scripting

Remove lines with duplicate first field

Trying to cut down the size of some log files. Now that I write this out it looks more dificult than i thought it would be. Need a bash script or command that goes sequentially through all lines of a file, and does this: if field1 (space separated) is the number 2012 print the entire line. Do... (7 Replies)
Discussion started by: ajp7701
7 Replies

4. 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

5. Shell Programming and Scripting

Remove duplicate based on Group

Hi, How can I remove duplicates from a file based on group on other column? for example: Test1|Test2|Test3|Test4|Test5 Test1|Test6|Test7|Test8|Test5 Test1|Test9|Test10|Test11|Test12 Test1|Test13|Test14|Test15|Test16 Test17|Test18|Test19|Test20|Test21 Test17|Test22|Test23|Test24|Test5 ... (2 Replies)
Discussion started by: yale_work
2 Replies

6. 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

7. 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

8. 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

9. 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

10. UNIX for Dummies Questions & Answers

Using awk to remove duplicate line if field is empty

Hi all, I've got a file that has 12 fields. I've merged 2 files and there will be some duplicates in the following: FILE: 1. ABC, 12345, TEST1, BILLING, GV, 20/10/2012, C, 8, 100, AA, TT, 100 2. ABC, 12345, TEST1, BILLING, GV, 20/10/2012, C, 8, 100, AA, TT, (EMPTY) 3. CDC, 54321, TEST3,... (4 Replies)
Discussion started by: tugar
4 Replies
DateTime::Locale::ti_ER(3)				User Contributed Perl Documentation				DateTime::Locale::ti_ER(3)

NAME
DateTime::Locale::ti_ER SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'ti_ER' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Tigrinya Eritrea. DATA
This locale inherits from the DateTime::Locale::ti locale. It contains the following data. Days Wide (format) XXX XXX XXX XXX XXX XXX XXXX Abbreviated (format) XXX XXX XXX XXX XXX XXX XXX Narrow (format) X X X X X X X Wide (stand-alone) XXX XXX XXX XXX XXX XXX XXXX Abbreviated (stand-alone) XXX XXX XXX XXX XXX XXX XXX Narrow (stand-alone) X X X X X X X Months Wide (format) XX XXXX XXXX XXXX XXXX XX XXX XXX XXXXX XXXX XXX XXXX Abbreviated (format) XX XXX XXX XXX XXX XX XXX XXX XXX XXX XXX XXX Narrow (format) XX XXX XXX XXX XXX XX XXX XXX XXX XXX XXX XXX Wide (stand-alone) XX XXXX XXXX XXXX XXXX XX XXX XXX XXXXX XXXX XXX XXXX Abbreviated (stand-alone) XX XXX XXX XXX XXX XX XXX XXX XXX XXX XXX XXX Narrow (stand-alone) X X X X X X X X X X X X Quarters Wide (format) Q1 Q2 Q3 Q4 Abbreviated (format) Q1 Q2 Q3 Q4 Narrow (format) 1 2 3 4 Wide (stand-alone) Q1 Q2 Q3 Q4 Abbreviated (stand-alone) Q1 Q2 Q3 Q4 Narrow (stand-alone) 1 2 3 4 Eras Wide BCE CE Abbreviated X/X X/X Narrow X/X X/X Date Formats Full 2008-02-05T18:30:30 = XXXX 05 XXXX XXXX 2008 X/X 1995-12-22T09:05:02 = XXXX 22 XXXX XXXX 1995 X/X -0010-09-15T04:44:23 = XXXX 15 XXXXX XXXX -10 X/X Long 2008-02-05T18:30:30 = 05 XXXX 2008 1995-12-22T09:05:02 = 22 XXXX 1995 -0010-09-15T04:44:23 = 15 XXXXX -10 Medium 2008-02-05T18:30:30 = 05-XXX-2008 1995-12-22T09:05:02 = 22-XXX-1995 -0010-09-15T04:44:23 = 15-XXX--10 Short 2008-02-05T18:30:30 = 05/02/08 1995-12-22T09:05:02 = 22/12/95 -0010-09-15T04:44:23 = 15/09/-10 Default 2008-02-05T18:30:30 = 05-XXX-2008 1995-12-22T09:05:02 = 22-XXX-1995 -0010-09-15T04:44:23 = 15-XXX--10 Time Formats Full 2008-02-05T18:30:30 = 6:30:30 XXX XXX UTC 1995-12-22T09:05:02 = 9:05:02 XXX XXX UTC -0010-09-15T04:44:23 = 4:44:23 XXX XXX UTC Long 2008-02-05T18:30:30 = 6:30:30 XXX XXX UTC 1995-12-22T09:05:02 = 9:05:02 XXX XXX UTC -0010-09-15T04:44:23 = 4:44:23 XXX XXX UTC Medium 2008-02-05T18:30:30 = 6:30:30 XXX XXX 1995-12-22T09:05:02 = 9:05:02 XXX XXX -0010-09-15T04:44:23 = 4:44:23 XXX XXX Short 2008-02-05T18:30:30 = 6:30 XXX XXX 1995-12-22T09:05:02 = 9:05 XXX XXX -0010-09-15T04:44:23 = 4:44 XXX XXX Default 2008-02-05T18:30:30 = 6:30:30 XXX XXX 1995-12-22T09:05:02 = 9:05:02 XXX XXX -0010-09-15T04:44:23 = 4:44:23 XXX XXX Datetime Formats Full 2008-02-05T18:30:30 = XXXX 05 XXXX XXXX 2008 X/X 6:30:30 XXX XXX UTC 1995-12-22T09:05:02 = XXXX 22 XXXX XXXX 1995 X/X 9:05:02 XXX XXX UTC -0010-09-15T04:44:23 = XXXX 15 XXXXX XXXX -10 X/X 4:44:23 XXX XXX UTC Long 2008-02-05T18:30:30 = 05 XXXX 2008 6:30:30 XXX XXX UTC 1995-12-22T09:05:02 = 22 XXXX 1995 9:05:02 XXX XXX UTC -0010-09-15T04:44:23 = 15 XXXXX -10 4:44:23 XXX XXX UTC Medium 2008-02-05T18:30:30 = 05-XXX-2008 6:30:30 XXX XXX 1995-12-22T09:05:02 = 22-XXX-1995 9:05:02 XXX XXX -0010-09-15T04:44:23 = 15-XXX--10 4:44:23 XXX XXX Short 2008-02-05T18:30:30 = 05/02/08 6:30 XXX XXX 1995-12-22T09:05:02 = 22/12/95 9:05 XXX XXX -0010-09-15T04:44:23 = 15/09/-10 4:44 XXX XXX Default 2008-02-05T18:30:30 = 05-XXX-2008 6:30:30 XXX XXX 1995-12-22T09:05:02 = 22-XXX-1995 9:05:02 XXX XXX -0010-09-15T04:44:23 = 15-XXX--10 4:44:23 XXX XXX Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 EEEd (d EEE) 2008-02-05T18:30:30 = 5 XXX 1995-12-22T09:05:02 = 22 XXX -0010-09-15T04:44:23 = 15 XXX Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 XXX XXX 1995-12-22T09:05:02 = 9:05 XXX XXX -0010-09-15T04:44:23 = 4:44 XXX XXX Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 XXX XXX 1995-12-22T09:05:02 = 9:05:02 XXX XXX -0010-09-15T04:44:23 = 4:44:23 XXX XXX M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (M-d) 2008-02-05T18:30:30 = 2-5 1995-12-22T09:05:02 = 12-22 -0010-09-15T04:44:23 = 9-15 MEd (E, M-d) 2008-02-05T18:30:30 = XXX, 2-5 1995-12-22T09:05:02 = XXX, 12-22 -0010-09-15T04:44:23 = XXX, 9-15 MMdd (dd/MM) 2008-02-05T18:30:30 = 05/02 1995-12-22T09:05:02 = 22/12 -0010-09-15T04:44:23 = 15/09 MMM (LLL) 2008-02-05T18:30:30 = XXX 1995-12-22T09:05:02 = XXX -0010-09-15T04:44:23 = XXX MMMd (MMM d) 2008-02-05T18:30:30 = XXX 5 1995-12-22T09:05:02 = XXX 22 -0010-09-15T04:44:23 = XXX 15 MMMEd (E MMM d) 2008-02-05T18:30:30 = XXX XXX 5 1995-12-22T09:05:02 = XXX XXX 22 -0010-09-15T04:44:23 = XXX XXX 15 MMMMd (MMMM d) 2008-02-05T18:30:30 = XXXX 5 1995-12-22T09:05:02 = XXXX 22 -0010-09-15T04:44:23 = XXXXX 15 MMMMdd (dd MMMM) 2008-02-05T18:30:30 = 05 XXXX 1995-12-22T09:05:02 = 22 XXXX -0010-09-15T04:44:23 = 15 XXXXX MMMMEd (E MMMM d) 2008-02-05T18:30:30 = XXX XXXX 5 1995-12-22T09:05:02 = XXX XXXX 22 -0010-09-15T04:44:23 = XXX XXXXX 15 ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (y-M) 2008-02-05T18:30:30 = 2008-2 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -10-9 yMEd (EEE, y-M-d) 2008-02-05T18:30:30 = XXX, 2008-2-5 1995-12-22T09:05:02 = XXX, 1995-12-22 -0010-09-15T04:44:23 = XXX, -10-9-15 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 XXX 1995-12-22T09:05:02 = 1995 XXX -0010-09-15T04:44:23 = -10 XXX yMMMEd (EEE, y MMM d) 2008-02-05T18:30:30 = XXX, 2008 XXX 5 1995-12-22T09:05:02 = XXX, 1995 XXX 22 -0010-09-15T04:44:23 = XXX, -10 XXX 15 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 XXXX 1995-12-22T09:05:02 = 1995 XXXX -0010-09-15T04:44:23 = -10 XXXXX yQ (y Q) 2008-02-05T18:30:30 = 2008 1 1995-12-22T09:05:02 = 1995 4 -0010-09-15T04:44:23 = -10 3 yQQQ (y QQQ) 2008-02-05T18:30:30 = 2008 Q1 1995-12-22T09:05:02 = 1995 Q4 -0010-09-15T04:44:23 = -10 Q3 yyMM (MM/yy) 2008-02-05T18:30:30 = 02/08 1995-12-22T09:05:02 = 12/95 -0010-09-15T04:44:23 = 09/-10 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 yyyyMMMM (MMMM y) 2008-02-05T18:30:30 = XXXX 2008 1995-12-22T09:05:02 = XXXX 1995 -0010-09-15T04:44:23 = XXXXX -10 Miscellaneous Prefers 24 hour time? No Local first day of the week XXX SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.16.2 2013-08-25 DateTime::Locale::ti_ER(3)
All times are GMT -4. The time now is 12:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy