move files into subfolder and preserve directory structure

Started by stleusc, May 03, 2024, 09:20:22 PM

Previous topic - Next topic

stleusc

Here is what I want to do...

Let's say I have a folder /data/photos/....
Images are spread over subfolders and crazy structures.

I now want to MOVE all files that do NOT have exif data (specifically that are missing the tag that I would use to later rename the files) and 'relocate' them to /data/photos_no_exif/... while keeping the rest of the folder structure

In other words, /data/photos/ads/rerw/aggdf/image1.jpg moves to /data/photos_no_exif/ads/rerw/aggdf/image1.jpg

How can I do that?

StarGeek

You didn't mention what OS you are using. The command below is for Windows CMD. Change the double quotes to single quotes for Mac/Linux

First CD into /data/photos/.  Then test using this command to make sure it's working right, replacing TAG with the tag you are checking for or $EXIF:All for files that don't have any EXIF data.

exiftool -if "not $TAG" -Testname=/data/photos_no_exif/%d .

It will output the new directory for each file and if the output looks correct, then you would change Testname into Directory.


* 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).