Author Topic: Struggling with rather simple rename and sorting operation  (Read 975 times)

0mega42

  • Newbie
  • *
  • Posts: 1
Struggling with rather simple rename and sorting operation
« on: January 01, 2015, 10:11:30 AM »
Hi!

I'm trying to solve a rather simple problem - I guess - at least for someone familiar with ExifTool.


I have about 30.000 images, raw and jpg and also movs. Some have proper tags, others don't. Basically I want everything to be sorted into a folder structure by date and also renamed by date. Like this:

/.../2014/12/01/20141201_0001.JPG (first image of that day)
/.../2014/12/01/raw/20141201_0001.ORF (matching raw file if available)
/.../2014/12/01/mov/20141201_0001.MOV (first mov file of that day - matching numbering with images would be a plus)

I tried some commands, but due to the fact some tags aren't properly set in some files, my library gets all messed up. I read that there are scripts for fallbacks, but I'm not able to combine this with all the folder sorting. Any help is much appreciated!

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14438
    • ExifTool Home Page
Re: Struggling with rather simple rename and sorting operation
« Reply #1 on: January 01, 2015, 06:09:39 PM »
Matching the raw filename to the jpg would be very difficult.  I can't think of a way to accomplish this.  A command like this would do just the JPG images:

exiftool -d %Y/%m/%d/%Y%m%d_%.4nc.JPG -ext jpg "-filename<filemodifydate" "-filename<createdate" "-filename<datetimeoriginal" DIR

where DIR is the name of the source directory.

Here the DateTimeOriginal will be used to move/rename the file, failing that, CreateDate, then finally FileModifyDate (which is always available).

Similar commands may be used for the raw images and movie files, by changing the JPG/jpg and the directory in the date/time format string.

Be sure to try this out on some test files before unleashing it on your collection.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).