No Duplicates in text file
-
Hi, I am adding text to a text file but I don't want to have any duplicates. I am searching a system for files and if the file occurs twice I only want it added once to the text file. If any one can help it would be great. Thanks
johnjsm wrote:
Hi, I am adding text to a text file but I don't want to have any duplicates. I am searching a system for files and if the file occurs twice I only want it added once to the text file. If any one can help it would be great. Thanks
There are many ways of implementing this... You could write it to a database table and check if it already exists (probably the easiest method) You could create a tree structure or some kind of sorted array in memory and search in it...
-
Hi, I am adding text to a text file but I don't want to have any duplicates. I am searching a system for files and if the file occurs twice I only want it added once to the text file. If any one can help it would be great. Thanks
I agree with Chandra. The text file is just a place to store stuff when your app isn't running. So, do your work in memory, then write the end result to the file when your done. Don't try to work with it in the file itself.
Dave Kreskowiak Microsoft MVP - Visual Basic