Link to home
Start Free TrialLog in
Avatar of pipigril
pipigril

asked on

File list

I have file names in TXT file (1 name = 1 line). Now I need to compare file list in TXT with files in C:\WINDOWS and write to Memo names of files, which are new or added.
Delphi 3
Step by step, please...
Avatar of kretzschmar
kretzschmar
Flag of Germany image

hi pipigril,

read the textfile in a tstringlist
read the filenames in a tstringlist (findfirst/findnext)

now go through the file-Tstringlist and lookup in the text-Tstringlist with the indexof-method

if the result < 0 then add the filename to your memo

meikl
Avatar of edey
edey

or you could call command.com to pipe a dir c:\windows\*.* to a text file & load that, though the findFirst/findNext method would prob. be cleaner.

Gl
Mike
or you could use a TFileListBox compnent, point it at the appropriate
directory, and read a line of the file
and compare that to the lines in the component
ASKER CERTIFIED SOLUTION
Avatar of ckaneta
ckaneta

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial