organize library by camera model, date, etc

Started by tiagofb, May 05, 2016, 05:45:15 PM

Previous topic - Next topic

tiagofb


Hi,

I'm trying to organize a lot of files (jpgs) found on several directories. The idea is create the followin structure:

Camera Model/Year/Year-Month_Day/year_month_date-hour-minute-second.jpg

The command line I'm using is:

exiftool -r -o dummy/ -d %Y/%Y-%m/%Y-%m-%d\ %H-%M-%S%%-c.%%le "-filename<filemodifydate" -ext jpg directory_with_jpgs

My problem is insert Camera Model in the directory name. Its possible to get it by the EXIF TAG "Model" ("-directory<Model"), but i don't know the correct syntax.

First, I'm using -o to copy files only, to debug th command line, but when everything is correct, the idea is move files.

Anyone can help me??








StarGeek

Since you want to put it at the top of the directory hierarchy, you can stick it before filemodifydate, though it will require a slight format change.  Since you need to use multiple tags, we'll have to add the dollar sign in front of each tag.  And since it's possible for Model to have characters which are illegal for a filename path, those characters have to be removed.  That will be done using an empty advanced formatting command (see last paragraph of the -p option for more info).  Finally, I'm assuming you're using a Mac/Linux machine, since you have \ (SlashSpace) as part of your -d option and that won't work under windows.  So that means the double quotes will need to be changed to single quotes, otherwise bash will interpret the dollar signs incorrectly.

So try this as part of your command:
'-filename<${model;}/$filemodifydate'
* 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).

tiagofb


Perfect!
Problem solved.
A little trick learned.
Thanks a lot!