Message 1 of 2
Populate ListBox from Text File - Without Repeats
Not applicable
10-24-2008
07:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've seen many examples of populating a listbox from a text file, but my text file will have many repeats of the same items, and I'd like to weed these out, and just have a list of available items, with no repeats.
I'm presently working on the code, so I don't have anything to post yet. My present idea is to start an array with the first item from the text file, then compare the next item to the array entry, and if it does not match, then add it to the array. As the array grows, the text item will be compared to each item in the array, discarding any matches and adding any new items.
I'm sure I'll figure it out, but if anyone has something that's already done, I'd appreciate handouts. I'll post whatever I come up with if there are no responses.
Thanks.
I'm presently working on the code, so I don't have anything to post yet. My present idea is to start an array with the first item from the text file, then compare the next item to the array entry, and if it does not match, then add it to the array. As the array grows, the text item will be compared to each item in the array, discarding any matches and adding any new items.
I'm sure I'll figure it out, but if anyone has something that's already done, I'd appreciate handouts. I'll post whatever I come up with if there are no responses.
Thanks.