ExifTool Forum

ExifTool => Archives => Topic started by: Archive on May 12, 2010, 08:54:00 AM

Title: Search for images and cp them to different dir
Post by: Archive on May 12, 2010, 08:54:00 AM
[Originally posted by oozy on 2007-01-16 20:31:35-08]

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.
Title: Re: Search for images and cp them to different dir
Post by: Archive on May 12, 2010, 08:54:00 AM
[Originally posted by exiftool on 2007-01-17 00:00:39-08]

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:

Code:
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:

Code:
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