News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Reorder photos into date folders

Started by mallycat, August 05, 2012, 05:51:52 PM

Previous topic - Next topic

mallycat

Hi, newbie here.  I am trying to reorganise my photos into a flat folder structure using dates.  ie 2012_06_01.  I have read the documentation and am using the following command (as a test first using 2 sample files).

c:\exif\exiftool "-Directory<DateTimeOriginal" -d %Y_%m_%d *.jpg

As far as I can tell, this is the correct syntax.  Trouble is it is moving the photos to a folder titled m_d instead of the actual date.  I have run the exiftool on the jpg files and I can confirm that the date/time original metadata is definitely in the file itself.

Can someone please help me know what I am doing wrong.

StarGeek

I think you need quotes around the %Y_%m_%d part.
* 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).

mallycat

Thanks for the reply.  I have tried your suggestion as follows:

c:\exif\exiftool "-Directory<DateTimeOriginal" -d "%Y_%m_%d" *.jpg

but it didn't make any difference - same outcome.

mallycat

mmmmm, on  a hunch, I tried something different.  Sorry, I did not mention in the original post, but I am using a batch file to execute this command.  When I put the command in a batch file, it doesn't work.  When I enter the exact same command on the command line it works.   Can somone help me understand why.

mallycat

OK, now I know.  I searched the documentation to see if there was some special handling for batch files and found that there is.  Soi to complete the thread, this worked in a batch file

c:\exif\exiftool "-Directory<DateTimeOriginal" -d %%Y_%%m_%%d *.jpg

Phil Harvey

Yup.  You fell prey to the newbie .BAT must-escape-the-percent-symbol trap!

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