Can I Use Date Template Patterns in Copy/Move

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

Can I Use Date Template Patterns in Copy/Move

Postby TerryNMc2018 » Sat Dec 15, 2018 10:49 pm

I am trying to organize 30,000+ photos using BRU to standardize the file names in yyyy-mm-dd hhmmss_IMG01234.JPG format. I want the final result to be in a folder hierarchy like
2018
2018-01
2018-01-15

Can I use %Y, %Y-%m, and %Y-%m-%d in the Path spec for Copy/Move to Location(13) to achieve this?

I'm currently using a program call PhotoMove to do this but I have not control over the exact format of the folder names. (It uses _ where I want to use -)

If BRU could (or can!) do this, it would greatly simplify my work flow.

Or, is there some way to already achieve this sort of action in some other way that I don't yet understand. Seems to me that BRU can do just about everything!
TerryNMc2018
 
Posts: 1
Joined: Sat Dec 15, 2018 10:31 pm

Re: Can I Use Date Template Patterns in Copy/Move

Postby bru » Sat Mar 16, 2019 8:16 pm

If you meant to post this in the BRU section: #13Path wont allow %DateFormats.
If you meant it for the BRC section, it lacks this ability as well, but you could use a batch:

@echo off
Setlocal EnableDelayedExpansion
For /f "tokens=1,2,3,4* delims=- " %%A IN ('dir/b "????-??-?? *.jpg"') DO (
md %%A 2>nul
md %%A\%%B 2>nul
md %%A\%%B\%%C 2>nul
MOVE "%%A-%%B-%%C %%D" "%%A\%%B\%%C\"
brc32 /dir:"%%A\%%B\%%C\" /ignorefilex /regexp:"^[12]\d{3}-[01][0-9]-[0-3][0-9] (.*\.(jpg|JPG))$:\1" /execute
)
pause
echo.All files moved and renamed, press any key to exit

That would create your directory-structure, move the files, and then let BRC rename them.
(BRC just removes the %Y-%m-%d prefix, leaving everything else)
bru
 
Posts: 14
Joined: Wed Jan 31, 2018 7:35 pm

Re: Can I Use Date Template Patterns in Copy/Move

Postby bru » Mon Mar 18, 2019 5:35 pm

Edit - Setlocal isnt needed, was planning something else.
Batch edited for better flow, rename/move results still exactly the same:

@echo off
For /f "tokens=1,2,3,4* delims=- " %%A IN ('dir/b "????-??-?? *.jpg"') DO (
md %%A 2>nul
md %%A\%%B 2>nul
md %%A\%%B\%%C 2>nul
MOVE "%%A-%%B-%%C %%D" "%%A\%%B\%%C\"
brc32 /dir:"%%A\%%B\%%C\" /ignorefilex /regexp:"^[12]\d{3}-[01][0-9]-[0-3][0-9] (.*\.(jpg|JPG))$:\1" /execute
)
echo.All files moved and renamed, press any key to exit
pause>nul
bru
 
Posts: 14
Joined: Wed Jan 31, 2018 7:35 pm


Return to BRC Support