Page 1 of 1

Copying duplicate file names after search

Posted: 11 Jul 2011 02:26
by Kinect
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?

Re: Copying duplicate file names after search

Posted: 11 Jul 2011 09:13
by Stefan
Hi Kinect
Kinect wrote:After a search, how do I copy files with the same names into another drive
Did that make sense to you?
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]

Re: Copying duplicate file names after search

Posted: 11 Jul 2011 09:19
by admin
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?
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.

Re: Copying duplicate file names after search

Posted: 11 Jul 2011 09:28
by Kinect
admin wrote:
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?
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.

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?

Re: Copying duplicate file names after search

Posted: 11 Jul 2011 09:31
by Stefan
Oh :shock: misinterpreted :mrgreen:

Re: Copying duplicate file names after search

Posted: 11 Jul 2011 10:52
by admin
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?
Yes:

- 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.