ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: EvilUnicorn on November 17, 2022, 09:14:54 AM

Title: Creating nested folders on Windows
Post by: EvilUnicorn on November 17, 2022, 09:14:54 AM
I'm using the Windows installer version by Oliver Betz.

For now I'm not even trying to rename files, just to move them to a new folder structure. I'm struggling to get it to work though. I starting of as simple as possible so all files are in a single folder. Goal is to reorganize to this folder structure: Year - month - brand and make
I tried:
exiftool -d -r "%Y/%m - %B" "-directory/$CreateDate/${model;}" .
but that results in invalid tag nare error. I guess I'm combining commands I found in a wrong way. Any suggestions on how to get this working?

Regards

Title: Re: Creating nested folders on Windows
Post by: StarGeek on November 17, 2022, 11:37:13 AM
The Directory is a "pseudo-tag" (see Writing "FileName" and "Directory" tags (https://exiftool.org/filename.html)) and is treated like any other tag.  So to copy from the create date, you would use the less/greater than signs (see Common Mistake #5 (https://exiftool.org/mistakes.html#M5)).

Also, you are splitting the -d (-dateFormat) option (https://exiftool.org/exiftool_pod.html#d-FMT--dateFormat) from the format string by sticking the -r (-recurse) option (https://exiftool.org/exiftool_pod.html#r-.--recurse) in the middle.

You command would more like this, assuming Windows CMD
exiftool -r -d "%Y/%m - %B" "-Directory<%d$CreateDate/${model;}" .

If you are using Mac/Linux/Powershell, change the double quotes to single quotes.  Also, you might want to change Directory into Testname to make sure the directory paths are correct before actually using Directory.
Title: Re: Creating nested folders on Windows
Post by: EvilUnicorn on November 17, 2022, 01:28:47 PM
Thanks, I'm making progress I guess. The command does fail with error message:

Warning: No writable tags set from ./20201111_143744.jpg
Warning: Invalid tag name '%d/'. Use '=' not '<' to assign a tag value - ./20201111_143744.jpg

I'll try some more
Title: Re: Creating nested folders on Windows
Post by: StarGeek on November 17, 2022, 02:27:06 PM
That error shows that the CreateDate and Model are not being read.  If you did not remove them, make sure your re-read my post and adjust the command as noted based upon what command line you are using.
Title: Re: Creating nested folders on Windows
Post by: EvilUnicorn on November 17, 2022, 04:40:48 PM
That did it (" should be ')! On to renaming the files.

Thank you
Title: Re: Creating nested folders on Windows
Post by: EvilUnicorn on November 19, 2022, 04:35:32 AM
Thank you that clears things up!