Write part of Filename to Title-tag

Started by timsimp, October 10, 2017, 07:15:55 PM

Previous topic - Next topic

timsimp

Sorry guys, I have no clue how to do this...

I have 700 scans each with the following filename-structure:

Rezepte_001_Gebratener Chicorée.tif
Rezepte_002_Sommersalat mit Linsen und Ei.tif
Rezepte_003_Hirse-Tomaten-Gericht.tif
...

now I would like to write the name AFTER "Rezepte_001, Rezepte_002, ..." to the "Title"-Metadata field (e.g.: "Gebratener Chicorée", "Sommersalat mit Linsen und Ei", "Hirse-Tomaten-Gericht",...) Is there a way to do this with ExifTool?

Thank you so much for your help.
Tim

StarGeek

Are they all Rezepte_ or is there possibly a different word before that?  Also is it always 3 digits or is there a chance of more or less?

Also, I assume you don't want the extension (.tif or otherwise)?

Try this
exiftool "-Title<${Filename;s/Rezepte_\d{3}_(.*)\.[^.]+($)/$1/i}"

If you're on a Windows system, the characters with accents and such will probably cause trouble.  This may require reading up on FAQ 10.  My quick testing shows that you can add -L to the command and it will work, but throw a Warning: FileName encoding not specified error.  Adding -charset filename=cp1252 instead appears to work even better, as it doesn't throw an error on my system.

If some of your filenames contain other foreign characters, such as Cyrillic, then there are more likely to be problems, (again, read FAQ 10) as Windows command line doesn't play well with those character sets, IMO.

* 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).