Hi All,
I have done a search on this subject and found many a question and answer. But this one is a slightly different issue.
I need to check the 18th field (';' is the seperator) and remove any lines that have duplication in the 18th field and move these to another file. Here is some example data:
10000;105;CHEAPSIDE 105;2005-03-13 09:21:09;Mr;Jon;Smith;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888888;AG MYV65VODA P BLUE;N;cond-des;VODAFONE;1;;;;;;;7;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10001;106;BLACKPOOL 106;2005-03-13 09:21:09;Mrs;Anne;Jones;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888889;SAG MYX2 ORG P BLUE;G;cond-des;VODAFONE;;;;;;;26;17;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10002;108;SCARBOROUGH 108;2005-03-13 09:21:09;Mr;Jack;Jones;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888810;AIO SAGEM 820 TMOBIL;P;cond-des;VODAFONE;7;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10003;109;DARLINGTON 109;2005-03-13 09:21:09;Mr;Ian;Beard;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888811;ALCATEL 302 SIL A/C;N;cond-des;VODAFONE;;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10004;111;ALDERSHOT 111;2005-03-13 09:21:09;Mrs;Louise;Hogg;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888812;ALCATEL 302 SIL A/C;G;cond-des;VODAFONE;99;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10005;112;ROTHERHAM 112;2005-03-13 09:21:09;Mr;Adam;Shenton;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888813;SONY J70 T MOBILE;G;cond-des;VODAFONE;5;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10006;113;GLASGOW 113;2005-03-13 09:21:09;Mrs;Leah;McDonald;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888814;SIEM A55 VIRG BUNDLE;G;cond-des;O2;1;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10007;114;MILTON KEYNES 114;2005-03-13 09:21:09;Mr;John;Smith;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888815;SIE MC60 TMOB P;G;cond-des;O2;26;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10008;115;LIVERPOOL PARKER 115;2005-03-13 09:21:09;Mr;John;Trite;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888816;SAM A300 GSM C LGHT;P;cond-des;O2;1;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10009;116;CARLISLE 116 116;2005-03-13 09:21:09;Mr;Brian;Bungled;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888817;PAN GD87 ORG C;P;cond-des;O2;;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10010;117;HOUNSLOW 117;2005-03-13 09:21:09;Miss;Karen;Brown;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888818;PAN X300 GSM C SILV;P;cond-des;O2;;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10011;118;EDINBURGH 118;2005-03-13 09:21:09;Mr;Norman;Wisdom;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888819;PAN X300 GSM C SILV;N;cond-des;3;17;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10012;119;KIRKCALDY 119;2005-03-13 09:21:09;Miss;Julie;Jacobs;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888820;PAN X300 GSM C SILV;N;cond-des;3;7;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10013;121;CUMBERNAULD 121;2005-03-13 09:21:09;Mr;John;Terry;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888823;NOK 3200 VIRG P CLR;N;cond-des;3;17;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10014;122;CHATHAM 122;2005-03-13 09:21:09;Mr;Jack;Kahn;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888822;NOK 8310 GSM C LGHT;N;cond-des;O2;5;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10015;123;SOUTHPORT 123;2005-03-13 09:21:09;Mr;Liam;Neeson;45;The Hollow;Cheapside;;GTX 1BB;;;;;;IMEI99;NOK 8310 GSM C LGHT;;cond-des;O2;4;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10016;124;DERBY EAST ST 124;2005-03-13 09:21:09;Ms.;Sara;Sandringham;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888822;NOK 8310 GSM C HOT;F;cond-des;O2;9;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10017;125;DERBY EAST ST 125;2005-03-13 09:21:09;Ms.;Sara;Sandringham;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888823;NOK 8310 GSM C HOT;N;cond-des;VODAFONE;7;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10018;126;DERBY EAST ST 126;2005-03-13 09:21:09;Ms.;Sara;Sandringham;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888825;NOK 8310 GSM C HOT;G;cond-des;VODAFONE;6;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10019;127;DERBY EAST ST 127;2005-03-13 09:21:09;Ms.;Sara;Sandringham;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888888;NOK 8310 GSM C HOT;P;cond-des;VODAFONE;5;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10020;128;DERBY EAST ST 128;2005-03-13 09:21:09;Ms.;Sara;Sandringham;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888888;NOK 8310 GSM C HOT;N;cond-des;VODAFONE;4;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10021;129;DERBY EAST ST 129;2005-03-13 09:21:09;Ms.;Sara;Sandringham;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888888;NOK 8310 GSM C HOT;G;cond-des;VODAFONE;3;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
For example: I have 2 lots of "357888888888823" and 3 lots of "357888888888888". I need these lines stripping out and transferred to another file.
Any ideas?
Thanks in advance.
( "To become Wise, first you must ask Questions"
I have done a search on this subject and found many a question and answer. But this one is a slightly different issue.
I need to check the 18th field (';' is the seperator) and remove any lines that have duplication in the 18th field and move these to another file. Here is some example data:
10000;105;CHEAPSIDE 105;2005-03-13 09:21:09;Mr;Jon;Smith;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888888;AG MYV65VODA P BLUE;N;cond-des;VODAFONE;1;;;;;;;7;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10001;106;BLACKPOOL 106;2005-03-13 09:21:09;Mrs;Anne;Jones;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888889;SAG MYX2 ORG P BLUE;G;cond-des;VODAFONE;;;;;;;26;17;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10002;108;SCARBOROUGH 108;2005-03-13 09:21:09;Mr;Jack;Jones;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888810;AIO SAGEM 820 TMOBIL;P;cond-des;VODAFONE;7;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10003;109;DARLINGTON 109;2005-03-13 09:21:09;Mr;Ian;Beard;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888811;ALCATEL 302 SIL A/C;N;cond-des;VODAFONE;;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10004;111;ALDERSHOT 111;2005-03-13 09:21:09;Mrs;Louise;Hogg;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888812;ALCATEL 302 SIL A/C;G;cond-des;VODAFONE;99;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10005;112;ROTHERHAM 112;2005-03-13 09:21:09;Mr;Adam;Shenton;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888813;SONY J70 T MOBILE;G;cond-des;VODAFONE;5;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10006;113;GLASGOW 113;2005-03-13 09:21:09;Mrs;Leah;McDonald;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888814;SIEM A55 VIRG BUNDLE;G;cond-des;O2;1;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10007;114;MILTON KEYNES 114;2005-03-13 09:21:09;Mr;John;Smith;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888815;SIE MC60 TMOB P;G;cond-des;O2;26;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10008;115;LIVERPOOL PARKER 115;2005-03-13 09:21:09;Mr;John;Trite;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888816;SAM A300 GSM C LGHT;P;cond-des;O2;1;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10009;116;CARLISLE 116 116;2005-03-13 09:21:09;Mr;Brian;Bungled;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888817;PAN GD87 ORG C;P;cond-des;O2;;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10010;117;HOUNSLOW 117;2005-03-13 09:21:09;Miss;Karen;Brown;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888818;PAN X300 GSM C SILV;P;cond-des;O2;;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10011;118;EDINBURGH 118;2005-03-13 09:21:09;Mr;Norman;Wisdom;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888819;PAN X300 GSM C SILV;N;cond-des;3;17;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10012;119;KIRKCALDY 119;2005-03-13 09:21:09;Miss;Julie;Jacobs;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888820;PAN X300 GSM C SILV;N;cond-des;3;7;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10013;121;CUMBERNAULD 121;2005-03-13 09:21:09;Mr;John;Terry;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888823;NOK 3200 VIRG P CLR;N;cond-des;3;17;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10014;122;CHATHAM 122;2005-03-13 09:21:09;Mr;Jack;Kahn;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888822;NOK 8310 GSM C LGHT;N;cond-des;O2;5;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10015;123;SOUTHPORT 123;2005-03-13 09:21:09;Mr;Liam;Neeson;45;The Hollow;Cheapside;;GTX 1BB;;;;;;IMEI99;NOK 8310 GSM C LGHT;;cond-des;O2;4;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10016;124;DERBY EAST ST 124;2005-03-13 09:21:09;Ms.;Sara;Sandringham;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888822;NOK 8310 GSM C HOT;F;cond-des;O2;9;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10017;125;DERBY EAST ST 125;2005-03-13 09:21:09;Ms.;Sara;Sandringham;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888823;NOK 8310 GSM C HOT;N;cond-des;VODAFONE;7;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10018;126;DERBY EAST ST 126;2005-03-13 09:21:09;Ms.;Sara;Sandringham;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888825;NOK 8310 GSM C HOT;G;cond-des;VODAFONE;6;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10019;127;DERBY EAST ST 127;2005-03-13 09:21:09;Ms.;Sara;Sandringham;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888888;NOK 8310 GSM C HOT;P;cond-des;VODAFONE;5;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10020;128;DERBY EAST ST 128;2005-03-13 09:21:09;Ms.;Sara;Sandringham;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888888;NOK 8310 GSM C HOT;N;cond-des;VODAFONE;4;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
10021;129;DERBY EAST ST 129;2005-03-13 09:21:09;Ms.;Sara;Sandringham;45;The Hollow;Cheapside;;GTX 1BB;;;;;;357888888888888;NOK 8310 GSM C HOT;G;cond-des;VODAFONE;3;;;;;;;;flt dsc;0;chrge cond;1003052S;12345;2005-03-14 13:14:15;
For example: I have 2 lots of "357888888888823" and 3 lots of "357888888888888". I need these lines stripping out and transferred to another file.
Any ideas?
Thanks in advance.
( "To become Wise, first you must ask Questions"