Rename / Delete | Title from metadata (PDF files)

Started by andy95, December 04, 2014, 07:24:06 AM

Previous topic - Next topic

andy95

Hello,

I hope for a little help.

If I make this: exiftool -ext pdf "-filename>title" -r <directory>\
ExifTool write the filename to PDF -> title - OK, Very nice!

But all title with the extension (filename.pdf). How can I delete the extension .pdf in title (name)?

Thanks.

Phil Harvey

There are a few different ways.  The sample config file has a BaseName tag which does exactly this.  So you could use this config file and copy BaseName instead of FileName.  Alternatively you could use an advanced formatting expression to remove the extension:

exiftool -ext pdf "-title<${filename;s/\.[^.]*$//}" -r DIR

(the above quoting is for WIndows.  Use single quotes instead on Mac/Linux)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

andy95

Phil big thanks for your help!

Yes this is it what I search but the original file "DATE" are lost if I make it.

This is not good because all files have the same date and year.

Have you a last idea for this problem for me?

Thanks's again.

andy95

Ok, I found it ...

exiftool -ext pdf -overwrite_original "-title<${filename;s/\.[^.]*$//}" "-filemodifydate-=1" -r DIR


Hayo Baan

Andy, it looks like you want to maintain the original file modification time, yes?
Use the -P command line option for this, this preserves the modification time (your way subtracted 1 day from it).

Hope this helps,
Hayo
Hayo Baan – Photography
Web: www.hayobaan.nl