Hello.
I can not figure out how to rename and move RAW files with different extensions from one folder to folders by year and day.
I have:
testfolder/
file1.cr2
file2.arw
I need:
2018/
2018_12_23/
20181223_165415.cr2
2019/
2019_02_03/
20190203_122532.arw
Try this test command, alter the path as needed
exiftool -d "%Y_%m_%d/%Y%m%d_%H%M%S.%%e" "-Testname</path/to/targetfolder/$DateTimeOriginal" testfolder/
If the results from that look right, then change Testname to Filename. You don't mention your OS, so if you're on Mac/Linux, swap double quotes for single quotes.
Also, if there is a possibility of two pictures with the same time stamp, you might add -%%c to the date format after the %S so as to add an incremental number.
Спасибо, буду пробовать.
For me this option:
exiftool -r -d "%Y/%Y%m%d/%Y%m%d_%H%M%S.%%e" "-FileName<D:\_\test\$DateTimeOriginal" .
But how to adding File Number to end to file name?
I have "File number : 101-245" tag in my .cr2.
I need:
20180225_1546_101-245.cr2
Advanced formatting should allow for this, try:
exiftool -r -d "%Y/%Y%m%d/%Y%m%d_%H%M%S.%%e" "-FileName<${DateTimeOriginal;$_=qq(D:\\_\\test\\$_$$self{FileNumber})}" .
Or just move the extension out of the date string
exiftool -r -d "%Y/%Y%m%d/%Y%m%d_%H%M%S" "-FileName<D:\_\test\${DateTimeOriginal}_$FileNumber.%e" .
Quote from: Hayo Baan on July 10, 2019, 10:54:42 AM
Advanced formatting should allow for this, try:
exiftool -r -d "%Y/%Y%m%d/%Y%m%d_%H%M%S.%%e" "-FileName<${DateTimeOriginal;$_=qq(D:\\_\\test\\$_$$self{FileNumber})}" .
I'm trying it, but it doesn't work.
Quote from: StarGeek on July 10, 2019, 11:23:57 AM
Or just move the extension out of the date string
exiftool -r -d "%Y/%Y%m%d/%Y%m%d_%H%M%S" "-FileName<D:\_\test\${DateTimeOriginal}_$FileNumber.%e" .
It works.
Quote from: andreikorzhyts on July 10, 2019, 12:16:11 PM
I'm trying it, but it doesn't work.
Strange. I copy/pasted the command and it worked here. Glad the other version works for you, but I'm still curious about the error. What version of exiftool are you using?
Спасибо за помощь.
I'm attached screenshot. Hope this helps.
Strange. The command appears to be correct. But I can't replicate the error here.
Anyway, glad we got a working version for you.
Спасибо, буду использовать этот вариант.