copying each file of a folder into a matching folder

Post any Bulk Rename Utility support requirements here. Open to all registered users.

copying each file of a folder into a matching folder

Postby cvhmanchester » Thu Jan 16, 2025 1:33 pm

I have a folder with 120 files like
R699_iii_cvh4071_PM.tif
R700_iii_cvh4072_PM.tif
...

I want to copy each of the files in turn to a folder like
K:\VH_TurnerScans\R699
K:\VH_TurnerScans\R700
...

So I propose that BRU for each filename
copies "R???"
pastes it into "K:\VH_TurnerScans\R???\"
then performs the copy action: filename > K:\VH_TurnerScans\R???\filename

But both RegEx and Copy seem to apply the action only within the filename.
Append Folder name seems to apply the folder name to the file name, but I want a segment of the filename applied to the folder name.

Is there a way to capture R??? then paste it into Copy to location (13) string?

Thank you
cvhmanchester
 
Posts: 7
Joined: Fri Feb 07, 2020 6:14 pm

Re: copying each file of a folder into a matching folder

Postby Admin » Fri Jan 17, 2025 4:43 am

Hi, are the files

R699_iii_cvh4071_PM.tif
R700_iii_cvh4072_PM.tif
....

in K:\VH_TurnerScans\ ?

To create folders during renaming, enable the option :

Advanced Options > Allow Using '\' in Renaming Criteria for Creation of New Folders (Advanced Option)

Use this option with caution. This option can create new folders during renaming and can not be undone. With this option selected, if the new resulting file name contains a \, then a new folder is created, instead of just considering the file name invalid. So for example, if you had a file called a.txt and your renaming-criteria caused the file name a.txt to become 20190801\a.txt, then a new folder 20190801\ is created and the file a.txt is moved in there. This is called 'folderize'. Using this option, you can reorganize files into folders based on their timestamps, for instance.
Before using this option it is recommended to backup your files
Admin
Site Admin
 
Posts: 2725
Joined: Tue Mar 08, 2005 8:39 pm

Re: copying each file of a folder into a matching folder

Postby cvhmanchester » Fri Jan 17, 2025 9:33 am

Sorry, I should have been clearer.

All the source files are created on a SSD drive, used for fast capture and manipulation, e.g.
D:\TurnerG_C&W_PM\R699_iii_cvh4071_PM.tif

The target folders on a HDD are already in use and act as the archive for the scan and manipulated files of R699_i, R699_ii etc from various sources.
K:\VH_TurnerScans\R699 already has 10 files and 3 subfolders

I do this task with various workflows of the database about every two weeks, manually, so should appreciate a more general automatic solution.
cvhmanchester
 
Posts: 7
Joined: Fri Feb 07, 2020 6:14 pm

Re: copying each file of a folder into a matching folder

Postby Admin » Fri Jan 17, 2025 11:36 am

Hi, what you could do is:

1) Copy the files to be processed from SSD to HDD, from folder D:\TurnerG_C&W_PM\ to K:\VH_TurnerScans\
2) Then go to K:\VH_TurnerScans\ in BRU (or right click on the files to rename and select Bulk Rename Here in Windows File Explorer) and select all the files you want to move to a subfolder.
3) Use renaming criteria in BRU, Move/Copy Parts (6) -> Copy First n -> 4 -> To Start -> Sep \

This will rename a file such as R699_iii_cvh4071_PM.tif into R699\R699_iii_cvh4071_PM.tif, that is, it will move it into subfolder R699 of K:\VH_TurnerScans\

Make sure that the option Advanced Options > Allow Using '\' in Renaming Criteria for Creation of New Folders (Advanced Option) is enabled.
Admin
Site Admin
 
Posts: 2725
Joined: Tue Mar 08, 2005 8:39 pm

Re: copying each file of a folder into a matching folder

Postby Admin » Fri Jan 17, 2025 11:37 am

PS "Preview" before renaming to make sure it's how you need it.
Admin
Site Admin
 
Posts: 2725
Joined: Tue Mar 08, 2005 8:39 pm

Re: copying each file of a folder into a matching folder

Postby cvhmanchester » Sat Jan 18, 2025 11:39 am

Thank you. That works - so much better than manually moving each file over.

However, it can still be improved.
The target home folder has ca 1000 folders (and I have another 3 of those for various tasks), so the files renamed hidden at the bottom of a long list that I have to navigate through every time I access the list.

It takes about 4 minutes to copy the 51 files from the SSD to the HDD home folder, then 24 ms to change their folder names. The advantage is, there is time to make a coffee.

Could you add a more efficient method, something like I proposed, integrating the copying step? Perhaps by repurposing the clip function.

I wouldn't be without BRU.
cvhmanchester
 
Posts: 7
Joined: Fri Feb 07, 2020 6:14 pm

Re: copying each file of a folder into a matching folder

Postby Admin » Sat Jan 18, 2025 11:09 pm

4 minutes to copy the 51 files from SSD to HDD?
Admin
Site Admin
 
Posts: 2725
Joined: Tue Mar 08, 2005 8:39 pm


Return to BRU Support