wellster34
Programmer
Hello,
I have a few questions via UNIX scripting.
(1). Is there a way to find duplicates in a file?
(2). After finding duplicates, is there a way to weed them out to create a non-duplicate data file?
Example File called test.dat (using 3 characters per line)
123
456
789
ABC
123
DEF
GHI
In this example I want to have in my data file (test.dat):
123
456
789
ABC
DEF
GHI
Which is removing the second 123 that was found. Now, this example shows one 1 duplicate but I could have more than 1 duplicate. In some cases I had 4.
Any suggestions via UNIX?
Thanks
I have a few questions via UNIX scripting.
(1). Is there a way to find duplicates in a file?
(2). After finding duplicates, is there a way to weed them out to create a non-duplicate data file?
Example File called test.dat (using 3 characters per line)
123
456
789
ABC
123
DEF
GHI
In this example I want to have in my data file (test.dat):
123
456
789
ABC
DEF
GHI
Which is removing the second 123 that was found. Now, this example shows one 1 duplicate but I could have more than 1 duplicate. In some cases I had 4.
Any suggestions via UNIX?
Thanks