Let's suppose I have a file like this (but with many more records).
That is a sequence of records, each composed by: a header line, the data list and an end-of-record delimiter ('**').
I'd like to:
1- retain the unique data, that is, excluding duplicate records. This should be done comparing the fields 5, 6, 7, 9 and 10 of the header lines.
2.- list ALL the duplicates (for further examination).
In the example above, it should return:
for the unique, and
for the dupes. Is there a simple way to achieve this?
Great, that did it seamlessly! I try to understand how this piece of code works but it's far beyond my skills.
Now, let me ask for a step further. If I have this list of duplicate records :
I want to retain only one (or more) of the dupes, sending the remaining to another file. The criteria to retain one record would be:
if the second characters on $8 of the "header" are different, retain both
else retain the one with greater first character on $8
else retain the one with greater $13
else retain the one with $1~XX
else retain the one with $1~UN
In this case the output should be something like:
and and the rejected:
I hope you can help me. Thanks,
While I'm happy to help, I don't have time to do it all for you. Try to understand the awk code provided and modify it to fit your requirements. Others may help if you get stuck.
While I'm happy to help, I don't have time to do it all for you. Try to understand the awk code provided and modify it to fit your requirements. Others may help if you get stuck.
Thanks. I understand and appreciate your help.
Regs,
Gents,
Please give a help
file
--BAD STATUS NOT RESHOOTED--
*** VP 41255/51341 in sw 2973
*** VP 41679/51521 in sw 2973
*** VP 41687/51653 in sw 2973
*** VP 41719/51629 in sw 2976
--BAD COG NOT RESHOOTED--
*** VP 41689/51497 in sw 2974
*** VP 41699/51677 in sw 2974
*** VP... (18 Replies)
I have 2 files
"File 1" is delimited by ";" and "File 2" is delimited by "|".
File 1 below (3 record shown):
Doc1;03/01/2012;New York;6 Main Street;Mr. Smith 1;Mr. Jones
Doc2;03/01/2012;Syracuse;876 Broadway;John Davis;Barbara Lull
Doc3;03/01/2012;Buffalo;779 Old Windy Road;Charles... (2 Replies)
Hi,
In a file, I have to mark duplicate records as 'D' and the latest record alone as 'C'.
In the below file, I have to identify if duplicate records are there or not based on Man_ID, Man_DT, Ship_ID and I have to mark the record with latest Ship_DT as "C" and other as "D" (I have to create... (7 Replies)
Consider my input is
10
10
20
then,
uniq -u will give 20 and uniq -dwill return 10.
But i need the output as ,
10
10
How we can achieve this?
Thanks (4 Replies)
Hi Unix gurus,
Maybe it is too much to ask for but please take a moment and help me out. A very humble request to you gurus. I'm new to Unix and I have started learning Unix. I have this project which is way to advanced for me.
File format: CSV file
File has four columns with no header... (8 Replies)
Hi,
I have a file with these records
abc
xyz
xyz
pqr
uvw
cde
cde
In my o/p file , I want all the non duplicate rows to be shown.
o/p abc
pqr
uvw
Any suggestions how to do this?
Thanks for the help.
rs (2 Replies)
Hi,
Need to find a duplicate records on the first column,
ANU4501710430989 0000000W20389390
ANU4501710430989 0000000W67065483
ANU4501130050520 0000000W80838713
ANU4501210170685 0000000W69246611... (3 Replies)
Dear All,
I have one file which looks like :
account1:passwd1
account2:passwd2
account3:passwd3
account1:passwd4
account5:passwd5
account6:passwd6
you can see there're two records for account1. and is there any shell command which can find out : account1 is the duplicate record in... (3 Replies)
Hi all
pls help me by providing soln for my problem
I'm having a text file which contains duplicate records .
Example:
abc 1000 3452 2463 2343 2176 7654 3452 8765 5643 3452
abc 1000 3452 2463 2343 2176 7654 3452 8765 5643 3452
tas 3420 3562 ... (1 Reply)
Hi Everyone,
I have a flat file of 1000 unique records like following : For eg
Andy,Flower,201-987-0000,12/23/01
Andrew,Smith,101-387-3400,11/12/01
Ani,Ross,401-757-8640,10/4/01
Rich,Finny,245-308-0000,2/27/06
Craig,Ford,842-094-8740,1/3/04
.
.
.
.
.
.
Now I want to duplicate... (9 Replies)