HI,
I'm looking for possibility to copy / move my photo files to the subfolders in a smart and automated way.
Problem:
I have a lot of files (photos) in one folder. File names have a similar file name scheme. (Usually) the beginning of the file name is the date and time the picture was taken.
YYYYMMDD_hhmmss_XXX.jpg
I am looking for options on how to sort (copy or move) these files to the appropriate folders whose folder names are based on part of the name of the copied file.
Simply put, copy files to folders whose folders names correspond to the date of photos taken.
[YYYYMMDD]
Goal:
Initial, (source) folder:
20191221_134153.jpg
20191222_181130.jpg
20191222_191155_HDR.jpg
20191223_092136_HDR.jpg
20191227_170157.jpg
20191227_170157(0).jpg
20191227_170157(1).jpg
20191227_223325.jpg
....
....
Destination Folder:
[20191221]
20191221_134153.jpg
[20191222]
20191222_134154.jpg
20191222_134155_HDR.jpg
[20191223]
20191223_134156_HDR.jpg
[20191227]
20191227_134157.jpg
20191227_134157(0).jpg
20191227_170157(1).jpg
20191227_223325.jpg
[....]
Thanks in advance!
Any ideas, plugins, scripts are appreciated. I have searched the forum and it seems nothing similar.
How to copy/move files (photos) to folders with part of the file name mask as the destination folder name?
Moderators: Hacker, petermad, Stefan2, white
-
- Junior Member
- Posts: 5
- Joined: 2019-12-29, 13:35 UTC
MRT: How to move files to folders with part of the file name mask as the destination folder name?
Hi and welcome, FreeStyler!
FROM:
\TopFld\
|--- 20191221_134153.jpg
|--- 20191222_181130.jpg
|--- 20191222_191155_HDR.jpg
....
TO:
\TopFld\20191221\
|--- 20191221_134153.jpg
\TopFld\20191222\
|--- 20191222_134154.jpg
|--- 20191222_134155_HDR.jpg
....
USE:
Select All: Ctr+A
Launch MRT (multi-rename tool): Ctrl+M
In MRT press F1-key to read more about how to split file name into parts by using the [N] token.
Next you can use an "\"-backslash between the name parts to create folders on the fly and move the files into that folders: [N1-8]\[N]
Also you can use Search&Replace with [x]RegEx: Search:(\d{8}).+ ;;; Replace:$1\\$0
More questions, just ask.
- - -
FROM:
\TopFld\
|--- 20191221_134153.jpg
|--- 20191222_181130.jpg
|--- 20191222_191155_HDR.jpg
....
TO:
\TopFld\20191221\
|--- 134153.jpg
\TopFld\20191222\
|--- 134154.jpg
|--- 134155_HDR.jpg
....
USE:
[N1-8]\[N10-]
or RegEx: Search: (\d{8}).(.+) ;;; Replace: $1\\$2
HTH?
FROM:
\TopFld\
|--- 20191221_134153.jpg
|--- 20191222_181130.jpg
|--- 20191222_191155_HDR.jpg
....
TO:
\TopFld\20191221\
|--- 20191221_134153.jpg
\TopFld\20191222\
|--- 20191222_134154.jpg
|--- 20191222_134155_HDR.jpg
....
USE:
Select All: Ctr+A
Launch MRT (multi-rename tool): Ctrl+M
In MRT press F1-key to read more about how to split file name into parts by using the [N] token.
Next you can use an "\"-backslash between the name parts to create folders on the fly and move the files into that folders: [N1-8]\[N]
Also you can use Search&Replace with [x]RegEx: Search:(\d{8}).+ ;;; Replace:$1\\$0
More questions, just ask.
- - -
FROM:
\TopFld\
|--- 20191221_134153.jpg
|--- 20191222_181130.jpg
|--- 20191222_191155_HDR.jpg
....
TO:
\TopFld\20191221\
|--- 134153.jpg
\TopFld\20191222\
|--- 134154.jpg
|--- 134155_HDR.jpg
....
USE:
[N1-8]\[N10-]
or RegEx: Search: (\d{8}).(.+) ;;; Replace: $1\\$2
HTH?

-
- Junior Member
- Posts: 5
- Joined: 2019-12-29, 13:35 UTC
Re: How to copy/move files (photos) to folders with part of the file name mask as the destination folder name?
Thanks for the support. It works as expected.
I've been using MRT for many years, but never before with the "\". MRT combined with the EXIF plugin gives the very powerful tool.
I've been using MRT for many years, but never before with the "\". MRT combined with the EXIF plugin gives the very powerful tool.
Re: How to copy/move files (photos) to folders with part of the file name mask as the destination folder name?
I don't think that is documented or is it? This should be added as I didn't know about it.Stefan2 wrote: 2019-12-29, 17:20 UTCNext you can use an "\" between the name parts to create folders on the fly and move the files into that folders: [N1-8]\[N]
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
Re: How to copy/move files (photos) to folders with part of the file name mask as the destination folder name?
It is. See TC help (press F1 while in MRT):
RegardsRename mask: file name
[...]
Files can now also be moved to other directories by specifying directory separators "\" (backslashes) in the name. Directories which do not exist yet will be created automatically.
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: How to copy/move files (photos) to folders with part of the file name mask as the destination folder name?
How could I have missed that? I did search for backslash just now but perhaps typed back slash. Anyway, I checked the history and it is been there since v8.0. Glad I know now but would liked to have know it earlier - but that is my own fault of course 

F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)