Use Part of Foldername in Filename

Started by Daniel L S, March 08, 2016, 06:28:02 AM

Previous topic - Next topic

StarGeek

Ah, I didn't catch that bitonals was below 31822000473199.  In that case, you can use the tag Filepath to get the absolute file path, then grab what you need with some regex, though that gets messy.

Try this:
exiftool "-documentname<${filepath;s/^.*\/(.*?)(?:\/[^\/]+){2}$/$1/}/$filename" -ext tif -overwrite_original .\bitonals\

Though this will fail if you try to recurse into subdirectories below bitonals.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype