How can remove duplicates in a file using UNIX?

Answers were Sorted based on User's Feedback



How can remove duplicates in a file using UNIX?..

Answer / j madhava rao

$sort -u filename will sorts the data and removes the duplicates lines from the output

Is This Answer Correct ?    17 Yes 1 No

How can remove duplicates in a file using UNIX?..

Answer / vishwababu

You can use UNIQ to remove duplicates frm a file but it can
consider only same consecutive records.
Ex: if u hve records as
1 vishwa
1 Shruti
2 Ravi
3 Naveen
1 vishwa
and if u use UNIQ cmd, then you wil get vishwa, Ravi, Naveen
and vishwa.
So perform sort before using UNIQ so tat to avoid duplicates

Is This Answer Correct ?    7 Yes 7 No

How can remove duplicates in a file using UNIX?..

Answer / prasad

Uniq -u File_name

It will remove duplicates records.

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More Data Stage Interview Questions

how can we perform the 2nd time extraction of client database without accepting the data which is already loaded in first time extraction

1 Answers   Reliance,


Hi this madan, in data stage one file in Empno 12345678910 in a table, i want target is  Empno 1                                2 3 4 5 6 7 8 9 10                                                                                             

5 Answers   Tech Mahindra,


how to export or import the jobs in .ISX file

0 Answers  


What are stage variables?

0 Answers  


in one scenario source flat file like Fileld1 00122001550056200568 00256002360014500896 00123004560078900258 00147004560025800256 divide each 5 numbers as one column i.e here i need field1 field2 field3 field4 00122 00155 00562 00568 00256 00236 00145 00896 00123 00456 00789 00258 00147 00456 00258 00256 plz help me....

4 Answers  






How can you write parallel routines in datastage PX?

0 Answers  


What can we do with datastage director?

0 Answers  


What is the use of datastage designer?

0 Answers  


i have a scenario in which i/p columns areID,salary with 1,1000 2,2000 and 3,3000 i need an extra column in the o/p named avg(salary)how can i get it?

4 Answers   L&T,


What are the different options associated with dsjob command?

0 Answers  


ename like ibm,tcs,hcl need display those records only how?

2 Answers  


What are the partitioning techniques available in link partitioner?

0 Answers  


Categories