(E-Mail Removed) wrote in news:1101328833.131813.52400
@c13g2000cwb.googlegroups.com:
> Hi all.
>
> I currently have 2 text files which contain lists of file names. These
> text files are updated by my code. What I want to do is be able to
> merge these text files discarding the duplicates.
>
> And to make it harder (or not???!!) my criteria for defining the
> duplicate is the left 15 (or so) characters of the file path.
> Help, as always, is greatly appreciated!
Take a look at the Microsoft Text Driver - you can run SQL queries on the
text file. Perhaps you can just query each file checking for dupes?
Or you could load the data into a datatable (or hash table type object?),
with the PK set as the filename... if a duplicate shows up, the datatable
should throw a duplicate PK exception which you would catch and ignore.
Or lastly... perhaps you should think of a different method of storing the
data? Maybe a database is a better idea than text files?
--
Lucas Tam ((E-Mail Removed))
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/