Hi all,
How to remove duplicates in Unix. Suppose i have file like bellow
1,primary,a
1,secondary,b
2,secondary,c
2,secondary,d
i want the output as
1,primary,a
2,secondary,c
Please give me the solution for this command..
Thanks in Advance..
Hi all,
How to remove duplicates in Unix. Suppose i have file like bellow
1,primary,a
1,secondary,b
2,secondary,c
2,secondary,d
i want the output as
1,primary,a
2,secondary,c
Please give me the solution for this command..
Thanks in Advance..
hi,
before I give the solution, I'd be glad you explain the logic behind the selection you wish to accomplish.
That is the exact job of uniq
. Why would you want to exclude that from your solution set?
Clearly, the lines
1,primary,a
1,secondary,b
are different. What is the reason why the upper one should be retained in the output and the lower omitted? The same question for the lines
2,secondary,c
2,secondary,d
How do you determine the "uniqueness" of input lines?
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.