help with 40k photos many folders

Started by maverickd, July 01, 2024, 09:27:28 PM

Previous topic - Next topic

maverickd

I have around 40k pictures in many folders. I want to rename all the pics with a simple scheme such as date taken and then I want to put the pics into folders based on year-month. When I run this can I do it against all the folders at once? If I have to do them separately then how do I deal with naming conflicts if there are pics in the new folders that have the same names? I've tried before to move all my pics into one folder but I always hit naming conflicts. What's the best approach to dealing with this mess?

StarGeek

You could use a command such as this example that is in the docs Renaming section.  It will rename as
YearMonthDay_HourMinuteSecond<-copynumber>.<extension>
The copy number will only appear when there is a duplicate name.

In that example, you could change Filename into Testname to do a dry run and see what the results are.

You pass the top level directory, for example d:\Pictures, and include the -r (-recurse) option and exiftool will process all the files in that directory and all subdirectories.

If you wanted them in a new directory, you would add that to the format string which is after the -d.  For example,
exiftool -r '-FileName<CreateDate' -d d:\NewDirectory\%Y-%m-%d/%H%M_%%f.%%e d:\OldDirectory

Search through these forums, there are literally thousands of examples on renaming files.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

maverickd

Thank you! How would you suggest that I handle the folder structure? I want to rename the pics as you suggested and put them into folders that are year_month or something similar. I do have a bunch of duplicates and I was going to handle them after I did this part. I'm not sure I trust a dupe finder, but if you have suggestions for one please let me know.

StarGeek

Just add the directory levels in. Adding year to the path, add \%Y\ at the spot you want. See Common Date Format Codes for the % variables to substitute for various date/time values. See the other examples in the Renaming section I linked above and there are more on the Writing "FileName" and "Directory" tags page.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).