|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 04:38 AM.. Reason: code tags... |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
I seems that this is nearly the same as you have here:
http://www.unix.com/shell-programmin...ue-file-2.html I may be that your request is difficult to understand, or you does not explain it good enough, since you does not get answer. |
| Sponsored Links | ||
|
|
#3
|
||||
|
||||
|
Jotne you are right, these posts are very similar, or they are not clear at all...
Wondering if we should not merge them... |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Remove duplicate based on Group | yale_work | Shell Programming and Scripting | 2 | 03-21-2012 08:36 PM |
| Remove duplicate lines based on field and sort | cokedude | Shell Programming and Scripting | 8 | 03-18-2012 03:43 PM |
| Remove lines with duplicate first field | ajp7701 | Shell Programming and Scripting | 7 | 03-18-2012 11:49 AM |
| Remove duplicate lines (the first matching line by field criteria) | joggdial3000 | Shell Programming and Scripting | 6 | 05-03-2010 11:18 AM |
| How to get remove duplicate of a file based on many conditions | reva | UNIX for Dummies Questions & Answers | 3 | 02-04-2010 06:53 AM |
|
|