Page 1 of 1
Multiple file copy from 1 folder to another
Posted: 07 Feb 2023 23:08
by Kpochmx
Hello
i've be lurking forums trying to find a new user easy way to copy multiple files from a folder to another (99.99% of the time is a JPG) based on a list
i work as editor for a company that send me via in-house software around of 300 JPEG files per project and i need to review and select them.
so i need to copy files using Live Filter view 1 by 1 from the XYplorer window to a folder (simply drag and drop) but is a bit complicated over the course of the day.
files are names FILENAME1_AA_BB.jpg a single file can have multiple combination for example:
FILENAME1_AA_BB
FILENAME1_AA_CC
FILENAME1_BB_DD
FILENAME2_AA_BB_CC
FILENAME2_DD_AA
So i make a list in excel and simply copy/paste to live view filter and select 1,2 or 3 available pictures and D&D to another folder
is there a way to load a txt file containing a list of pictures and copy all of them to another folder
Example:
FILENAME1***
FILENAME2***
FILENAME3***
FILENAME4***
FILENAME5***
no matter if they end in AB BB DD etc, just the UniqueID name.
Thanks
Re: Multiple file copy from 1 folder to another
Posted: 07 Feb 2023 23:36
by highend
Create a user defined command that executes a script and assign it a keyboard shortcut.
Store the unique file names in a file called "files.txt" (you can configure the name of it in the script) in the same folder where your files to copy are.
Execute the script while you are in the folder of the "files.txt" file, all belonging files will be selected so you can drag and drop them afterwards...
Code: Select all
$fileNameToLoad = "files.txt"; // Must be in the same folder as the files you want to copy
// ========================================================================
// == DO NOT CHANGE ANYTHING BELOW IF YOU DO NOT KNOW WHAT YOU ARE DOING ==
// ========================================================================
$srcFile = <curpath> . "\" . $fileNameToLoad;
end (exists($srcFile) != 1), quote($srcFile) . " not found, aborted!";
$content = formatlist(readfile($srcFile, 3:=65001), "sed", <crlf>);
end (!$content), quote($srcFile) . " is empty, aborted!";
$files = listfolder(, , 1+4, <crlf>);
$select = "";
foreach($entry, $content, <crlf>, "e") {
$esc = regexreplace($entry, "([\\^$.+()\[{])", "\$1") . ".*?(?=\r?\n|$)";
$matches = regexmatches($files, $esc, <crlf>);
if ($matches) { $select .= $matches . <crlf>; }
}
end (!$select), "No file(s) to select found, aborted!";
selectitems $select;
Re: Multiple file copy from 1 folder to another
Posted: 08 Feb 2023 09:08
by admin
The next beta comes with an enhanced version of
Edit | Select | Select Items.... It will then support wildcards, so you can pass your list like this and select all matching items in one go:
Code: Select all
FILENAME1*
FILENAME2*
FILENAME3*
FILENAME4*
FILENAME5*
Then it's just another click to copy them to your target folder.
Re: Multiple file copy from 1 folder to another
Posted: 08 Feb 2023 09:16
by admin
highend wrote: ↑07 Feb 2023 23:36
Code: Select all
// ========================================================================
// == DO NOT CHANGE ANYTHING BELOW IF YOU DO NOT KNOW WHAT YOU ARE DOING ==
// ========================================================================
Oh, what a useful addition to my text snippet library.

Re: Multiple file copy from 1 folder to another
Posted: 15 Feb 2023 18:59
by Kpochmx
This works perfectly!
Also sent PP tip
highend wrote: ↑07 Feb 2023 23:36
Create a user defined command that executes a script and assign it a keyboard shortcut.
Store the unique file names in a file called "files.txt" (you can configure the name of it in the script) in the same folder where your files to copy are.
Execute the script while you are in the folder of the "files.txt" file, all belonging files will be selected so you can drag and drop them afterwards...
Code: Select all
$fileNameToLoad = "files.txt"; // Must be in the same folder as the files you want to copy
// ========================================================================
// == DO NOT CHANGE ANYTHING BELOW IF YOU DO NOT KNOW WHAT YOU ARE DOING ==
// ========================================================================
$srcFile = <curpath> . "\" . $fileNameToLoad;
end (exists($srcFile) != 1), quote($srcFile) . " not found, aborted!";
$content = formatlist(readfile($srcFile, 3:=65001), "sed", <crlf>);
end (!$content), quote($srcFile) . " is empty, aborted!";
$files = listfolder(, , 1+4, <crlf>);
$select = "";
foreach($entry, $content, <crlf>, "e") {
$esc = regexreplace($entry, "([\\^$.+()\[{])", "\$1") . ".*?(?=\r?\n|$)";
$matches = regexmatches($files, $esc, <crlf>);
if ($matches) { $select .= $matches . <crlf>; }
}
end (!$select), "No file(s) to select found, aborted!";
selectitems $select;