Better way to do this and the -ext argument?

Started by iorx, May 13, 2015, 05:44:31 AM

Previous topic - Next topic

iorx

Hi!

To begin with. This tool is amazing! :D

I've got to newbie questions.
1. I've searched but can figure out if "-ext" could/should be used with multiple extensions "-ext jpg mp4 mts 3gp" for example.
2. My Windows .CMD down below is what I've come up with this far. It sorts and renames files in a way I want it. So for me it's OK, but is there a better way doing it? More efficient maybe?  :P



set srcdir=\\Q\Public\bild\foto\sorteras
set dstdir=\\Q\Public\bild\foto\%%Y\%%Y-%%m\%%Y-%%m-%%d\%%Y%%m%%d-%%H%%M%%S
set extraarg=-recurse -progress -preserve

rem * All files with a valid exif for date and model
exiftool "-filename<${DateTimeOriginal}-%%f_${model;tr/ /_/}.%%e" -d "%dstdir%" "%srcdir%" %extraarg%

rem * Remaning jpg with valid exif date
exiftool "-filename<${DateTimeOriginal}-%%f.%%e" -d "%dstdir%" "%srcdir%" -ext jpg %extraarg%

rem * Remaning jpg with no valid exif date use file date instead.
exiftool "-filename<${FileModifyDate}-%%f.%%e" -d "%dstdir%" "%srcdir%" -ext jpg %extraarg%

rem * mp4 by file date
exiftool "-filename<${FileModifyDate}-%%f.%%e" -d "%dstdir%" "%srcdir%"  -ext mp4 %extraarg%

rem * Some other file types
exiftool "-filename<${FileModifyDate}-%%f_video.%%e" -d "%dstdir%" "%srcdir%" -ext mts %extraarg%
exiftool "-filename<${FileModifyDate}-%%f_video.%%e" -d "%dstdir%" "%srcdir%" -ext 3gp %extraarg%

ping -n 30 127.0.0.1>nul


Brgs,

Phil Harvey

Quote from: iorx on May 13, 2015, 05:44:31 AM
1. I've searched but can figure out if "-ext" could/should be used with multiple extensions "-ext jpg mp4 mts 3gp" for example.

See the description of the -ext option in the application documentation for complete details.

Quote2. My Windows .CMD down below is what I've come up with this far. It sorts and renames files in a way I want it. So for me it's OK, but is there a better way doing it? More efficient maybe?  :P

If you want different structured names for different file types, then it makes sense to have a separate command for each.  But the jpg commands may be combined:

exiftool "-filename<${FileModifyDate}-%%f.%%e" "-filename<${DateTimeOriginal}-%%f.%%e" -d "%dstdir%" "%srcdir%" -ext jpg %extraarg%

- 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 ($).