Solved

Compare StringLists

Posted on 1998-05-28
2
941 Views
Last Modified: 2012-05-04
I am looking for a clever solution to compare the content of a StringList 1 with the content
of a StringList b. The content of StringList a is a "snapshot" of a directory a few days ago
(i.e the name of the files in this directory) and the content of StringList b are the the actual
filenames found in the same directory. Maybe there are some more files today than bevor
or somes are deleted.

Any hint is welcome!

Thanks a lot.
0
Comment
Question by:rjufer
2 Comments
 
LVL 7

Accepted Solution

by:
BlackMan earned 200 total points
Comment Utility
I think the best solution is to sort both lists. Then you can walk thru the lists in the following manner: (I call them A and B)

If A[index] < B[Index] Then A has items, that are not present in B. Increase Index until A[Index] >= B[Index]

Likewise, if B[index] < A[Index] Then B has items, that are not present in A. Increase Index until B[Index] >= A[Index]

When Index exceeds the number of items in either list A or B, the remaining items in the other list are new entries.
0
 

Author Comment

by:rjufer
Comment Utility
Hi

Thanks very mutch for your hint, just great .....!!!!

Rolf
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now