Answer the question
In order to leave comments, you need to log in
Moving all files except .pdf to another folder, how to do?
I ask for help.
There is a program for text recognition. The profile is set up in such a way that it takes all the contents of an incoming email, copies it to a temporary folder, then takes all the files from it and sends it for recognition. For recognition, it takes only .pdf and .tiff files, ignores the rest, then cleans the temporary folder.
You need to add a script to the profile that would take all other files from the temporary folder and simply move them to the desired one. According to the manual for the program:
Scripting can be done in C# either by writing scripting code in the Scripting Editor.
Answer the question
In order to leave comments, you need to log in
something like this
string pathSource = "D:\\test\\files";
string pathCopyTo = "D:\\test\\copyTo";
Regex regex =new Regex(@".*pdf$");
foreach (var item in Directory.GetFiles(pathSource))
{
if (!regex.IsMatch(item)) {
File.Move(item,item.Replace(pathSource, pathCopyTo));
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question