copy selected files keeping structure

Started by Pereto, November 06, 2021, 04:38:08 PM

Previous topic - Next topic

Pereto

Hello and thanks for everything.

I'm trying to recursively copy files that meet a condition, but I can't keep the original hierarchy in the destination directory.

I would appreciate if you would tell me where I am going wrong

I'm executing (Windows 10, powershell):
exiftool.exe -r -o DSTDIR -if '$category=~/Yecla/' SRCDIR

StarGeek

Use the %d token as listed under the Advanced features of the -w (-TextOut) option.

I'm assuming that you want to remove a few of the top levels of the original directory path, so you would use %:#d, replacing the hashtag # with the number of top levels you want to remove and hardcode what you want in front of it.  For example, if your file path was C:\Level2\Level3\Level4\file.jpg and you wanted to remove the top two levels, your command would be something like
exiftool.exe -r -o DSTDIR\%:2d -if '$category=~/Yecla/' SRCDIR
and you would end up with
DSTDIR\Level3\Level4\file.jpg
"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

Pereto


Pereto