Thread

Posted on Tue Jan 16 22:31:35 2007 by oozy
Search for images and cp them to different dir
How can I search for images in a direcotry and cp them to a different dir with names like A00001.jpg, A00002.jpg etc. I tried

exiftool -R -filename -w A_%c.jpg .

but I am getting F_1.jpg and F_2.jpg, etc. The images are corrupted. I mean I can't open them. They have errors.
Direct Responses: 4060 | Write a response
Posted on Wed Jan 17 02:00:39 2007 by exiftool in response to 4055
Re: Search for images and cp them to different dir
The -w option is for writing output text. Use the -o option to set the output image file name. So I think this may do what you want:

exiftool -r -ext jpg -o A%.5c.jpg .

This command will rewrite all JPEG images in directories rooted at the current directory, effectively copying them, although not the most efficient way to do this. Note the '.' after the '%' character, which causes the first file to be named "A00000.jpg" instead of "A.jpg". (Either way, files after this are named "A00001.jpg", "A00002.jpg", etc.)

A more efficient method would be this:

exiftool -r -ext jpg -filename=./A%.5c .

which renames the files without reprocessing them. Unfortunately though, this command does not leave a copy of the image in the original location, which is what I think you wanted. So you are stuck doing it with the first command above.

- Phil
Write a response