У меня есть папка, содержащая много файлов, например:
C:\Tmp\Input\random00001.txt
C:\Tmp\Input\random00002.txt
C:\Tmp\Input\random00003.txt
...
C:\Tmp\Input\random10000.txt
У меня есть большой список (около двух / трех сотен) указанных c имен файлов, которые мне нужно скопировать в другую папку , т.е.:
random00002.txt
random00009.txt
random04001.txt
...
random90000.txt
Я пытался использовать поиск windows, разделяющий имена файлов с помощью ключевого слова OR
, но файлов слишком много, и он обрезает строку фильтра ...

Я также пытался написать функцию, которая позволяет копировать файлы с использованием фильтра, но, похоже, не работает с ключевым словом OR
uses
SysUtils, IOUtils;
procedure CopyFiles(const AInputPath : string; const AOutputPath : string; const AFilter : string = '*.*');
var
Found : boolean;
Res: TSearchRec;
begin
Found := (FindFirst(AInputPath + AFilter, faAnyFile, Res) = 0);
while(Found) do
begin
if((Res.Attr AND faDirectory = 0) AND (Res.Name <> '.') AND (Res.Name <> '..')) then
begin
TFile.Copy(AInputPath + Res.Name, AOutputPath + Res.Name);
end;
Found := (FindNext(Res) = 0);
end;
FindClose(Res);
end;