There is a file with data and i have to remove the duplicate words from a file and write the non repeated words to other file. Does anyone have tried the optimal solution for this?
Printable View
There is a file with data and i have to remove the duplicate words from a file and write the non repeated words to other file. Does anyone have tried the optimal solution for this?
What about the straight forward, simple solution? Do you have that working? Then worry about making it optimal.
My idea is to read all the words in a file in to a LinkedHashSet. And once the file read we can write the contents of LinkedHashSet to a second file.