Adding text to command for re-naming a file

Started by pizzipie, December 30, 2016, 08:09:13 PM

Previous topic - Next topic

pizzipie

Hi,

I am brand new to ExifTool.

The first thing I tried to do was rename an Image file.

I wanted to do something like this.

-rw-r--r-- 1 rick rick 2861568 Dec  6 08:33 20161206_WagonWest-01.jpg
-rw-r--r-- 1 rick rick 3038208 Dec  8 17:50 20161208_WagonWest-01.jpg
-rw-r--r-- 1 rick rick 2946560 Dec 10 17:39 20161210_WagonWest-01.jpg
-rw-r--r-- 1 rick rick 2789888 Dec 10 17:39 20161210_WagonWest-02.jpg
-rw-r--r-- 1 rick rick 2896896 Dec 16 16:04 20161216_WagonWest-01.jpg
-rw-r--r-- 1 rick rick 2845696 Dec 20 09:51 20161220_WagonWest-01.jpg
-rw-r--r-- 1 rick rick 3047936 Dec 20 09:12 20161220_WagonWest-02.jpg
-rw-r--r-- 1 rick rick 3006976 Dec 25 17:24 20161225_WagonWest-01.jpg
-rw-r--r-- 1 rick rick 2339328 Dec 25 17:37 20161225_WagonWest-02.jpg
rick@rick-Latitude-E6510:~/Pictures/exifPlay/wwest$ exiftool -filename= 'CreateDate_MyNewString.jpg'   ./20161206_WagonWest-01.jpg
Error: File not found - CreateDate_MyNewString.jpg
    0 image files updated
    1 image files unchanged
    1 files weren't updated due to errors


Where can I find the errors.

What is the proper syntax for this?

Thanks,
R

StarGeek

The first problem is that you have a space between -filename= and what you want to rename the filename to.

But this command will not work how you want.  Since you want to use a tag in the name, you need to use < (tag copy) instead of = (value assignment).  Also, since you're adding more than just the tag, you'll have to add a $ to the start of the tag.  Because you're adding directly on to the end of the tag, you'll need to encase the tag name in braces so exiftool knows where the tag name ends.  Finally, since you're doing a tag copy, you'll have to encase that part in quotes (single quotes since you appear to be using a linus/mac OS) to avoid file redirection from the OS.

Try something like this:
exiftool '-filename<${CreateDate}_MyNewString.jpg'   ./20161206_WagonWest-01.jpg
* 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).

pizzipie

 :)

Thanks StarGeek,

This is a start for me. I'll try to build on this.

R