Hi,
After a search, how do I copy files with the same names into another drive because the files are in different folders and have different sizes and dates.
I don't want to replace them with one another due to same file name.
Can it be done?
Copying duplicate file names after search
-
Stefan
- Posts: 1360
- Joined: 18 Nov 2008 21:47
- Location: Europe
Re: Copying duplicate file names after search
Hi Kinect
It is no matter that the first found file is kept, and all others are proceeded?
What if you want to move the first file and keep the second?
If you know what you do you can try this script.
It will keep the first found file and put all others with same NAME into an array,
which you can use to do what you want wit those files.
If this script will work you (we?) can replace "text" with something else.
Did that make sense to you?Kinect wrote:After a search, how do I copy files with the same names into another drive
It is no matter that the first found file is kept, and all others are proceeded?
What if you want to move the first file and keep the second?
If you know what you do you can try this script.
It will keep the first found file and put all others with same NAME into an array,
which you can use to do what you want wit those files.
If this script will work you (we?) can replace "text" with something else.
Code: Select all
// Execute this script on an search result list.
// It will put the found files into an array, and from second found file
// with same name on, it store those names into an other array: arrayDubs.
// This arrayDubs you can use to do what you want later.
sel a;
$filelist = report("{path}?{name}<crlf>");
//Debug info:
text $filelist;
$array="All found files:<crlf>";
$arrayDubs="This names are found as dubs:<crlf>";
foreach($filespec, $filelist, "<crlf>"){
$filename = gettoken($filespec, 2, "?");
$pos = strpos($array, $filename);
if($pos == -1){
$array = $array . "$filename<crlf>";}
else{
$arrayDubs = $arrayDubs . replace($filespec,"?","\"). "<crlf>";}
}
//Debug info:
text $arrayDubs;
//ToDo:
//foreach file in arrayDubs Do : moveto location, [source], [rootpath], [flags]
-
admin
- Site Admin
- Posts: 67270
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Copying duplicate file names after search
Yes, what you want might be Rich Copy (you find this command in the drag-and-drop context menu). Rich Copy copies files together with their relative folder structure (relative to the search location) so nothing is overwritten.Kinect wrote:Hi,
After a search, how do I copy files with the same names into another drive because the files are in different folders and have different sizes and dates.
I don't want to replace them with one another due to same file name.
Can it be done?
FAQ | XY News RSS | XY X
-
Kinect
- Posts: 6
- Joined: 09 Jul 2011 15:48
Re: Copying duplicate file names after search
admin wrote:Yes, what you want might be Rich Copy (you find this command in the drag-and-drop context menu). Rich Copy copies files together with their relative folder structure (relative to the search location) so nothing is overwritten.Kinect wrote:Hi,
After a search, how do I copy files with the same names into another drive because the files are in different folders and have different sizes and dates.
I don't want to replace them with one another due to same file name.
Can it be done?
Thanks Admin! So cool!!!!!!!!!!
I have another question is: Can I save the search results so that I can re-look at the search results again another day without having to run the search routine again and continue looking at the next file that I've last seen?
-
Stefan
- Posts: 1360
- Joined: 18 Nov 2008 21:47
- Location: Europe
Re: Copying duplicate file names after search
Oh
misinterpreted 
-
admin
- Site Admin
- Posts: 67270
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Copying duplicate file names after search
Yes:Kinect wrote:I have another question is: Can I save the search results so that I can re-look at the search results again another day without having to run the search routine again and continue looking at the next file that I've last seen?
- Tick Configuration | Find Files | Cache search results.
- Do your search.
- Right-click the search results tab header and select New Tab.
- Right-click the header of the new tab and select Lock Location.
Now you have a safe tab to quickly access your search results in future. You can give it name (right-click / Rename Tab...) to easier identify it.
FAQ | XY News RSS | XY X
XYplorer Beta Club