ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: stleusc on May 03, 2024, 09:20:22 PM

Title: move files into subfolder and preserve directory structure
Post by: stleusc on May 03, 2024, 09:20:22 PM
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?
Title: Re: move files into subfolder and preserve directory structure
Post by: StarGeek on May 03, 2024, 10:29:17 PM
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.