Page 1 of 1

Boolen Copyto

Posted: 29 May 2023 01:35
by jinny
Please help!

I am trying to copy files with 2 or more names in them.

Example a file is named "blue cat eats dog in the morning" I want copy it using a script copyto

Code: Select all

copyto "D:\Test", "D:\Folder\*cat* && *dog*";
Doesn't work and returns and error but

Code: Select all

copyto "D:\Test", "D:\Folder\*cat* || *dog*";
Works perfectly but it returns all files named either cats or dogs

I have thousands of image files so i cant do them manually.

Re: Boolen Copyto

Posted: 29 May 2023 02:15
by jupe
copyto doesn't support that method, it supports wildcards only not boolean, if you refer to the help file it documents the possibilities, same with all scripting cmds. Something like this should work though:

copyto "D:\Test", "D:\Folder\*cat*dog*|D:\Folder\*dog*cat*";

Otherwise a better alternative with the power and flexibility of true boolean:

copyto "D:\Test", quicksearch(":cat & dog /fn", "D:\Folder");

I assume you don't want the search to be recursive, else change the /fn to /f

Re: Boolen Copyto

Posted: 29 May 2023 03:50
by jinny
They both worked like a charm.

Thank you so much.

What if i have names like "the cat ate the dog but it was for breakfast on sunday" and i need only images that contain cat, dog and breakfast?

What if i also don't need the results to contain "breakfast" and "sunday"? I have some product names like "blue coat with white print" I dont need any result that contains .... white print.

Re: Boolen Copyto

Posted: 29 May 2023 06:02
by jupe
Sorry I don't have time to try and explain the many permutations of boolean syntax to you, some other forum member might be willing, the help file should help if you try reading it. The easiest tip I can give though is to replace & with AND NOT in my previous example, for results you don't want, also keep in mind that you can test your search terms in the find files panel.

Re: Boolen Copyto

Posted: 12 Jul 2023 08:34
by kamini03
jupe wrote: 29 May 2023 06:02 Sorry I don't have time to try and explain the many permutations of boolean syntax to you, some other forum member might be willing, the help file should help if you try reading it. The easiest tip I can give though is to replace & with AND NOT in my previous example, for results you don't want, also keep in mind that you can test your search terms in the find files panel.
ok sir , thank you