ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: AnnieBrownTX on February 19, 2016, 01:24:42 PM

Title: How can I add a document property and populate it based on a cvs file
Post by: AnnieBrownTX on February 19, 2016, 01:24:42 PM
I basically have thousands of files that have been renamed by bates numbers, and I want to add the original file name as a document property "title" so I can see both file names.  I have a spreadsheet with two columns:  Current File Name (which is the Bates Number) and Original File Name (which I want to add to the "Title" or "comments" document properties - whichever you think is easier.  I don't want to change the files at all, just add the new metadata.

Can your tool do this?

Help!  I'm going crazy searching....!!!
Annie
Title: Re: How can I add a document property and populate it based on a cvs file
Post by: Phil Harvey on February 19, 2016, 01:43:35 PM
Hi Annie,

ExifTool could do this, but it doesn't have the ability to write metadata to most of the file types you require.  See the list of supported files (https://exiftool.org/index.html#supported) for a complete list.

- Phil
Title: Re: How can I add a document property and populate it based on a cvs file
Post by: AnnieBrownTX on February 19, 2016, 02:03:57 PM
Thank you so much for responding so quickly!

I don't understand your chart of supported types - It's been a long week, I'm sorry.

95% of the file types are .pdf and I can use ANY of the doc properties to add the original file name, it doesn't have to be Title.
I am attaching a screenshot of what I'm looking to achieve.

Again, please help!  I will be forever in your debt!  And will pay!!
Annie

Title: Re: How can I add a document property and populate it based on a cvs file
Post by: Phil Harvey on February 19, 2016, 02:07:42 PM
For PDF files (and JPEG, TIFF, PNG, etc -- basically any file with "W" support in the table I linked for which you can also write XMP), this is easy and you can use XMP:Title.  To do this:

1) Change the first line of your CSV file to

SourceFile,Title

2) "cd" to the directory containing the files, and run this command (assuming that your csv file is called "my.csv" and is in the same directory as the other files):

exiftool -csv=my.csv .

- Phil

(BTW, the forum mails are being bounced by your server: "reason: 521-130.15.24.20 blocked by sbc:blacklist.mailrelay.att.net.", so I had manually activated your account.)
Title: Re: How can I add a document property and populate it based on a cvs file
Post by: AnnieBrownTX on February 19, 2016, 02:19:06 PM
Does it matter if my files are in subfolders?

Like
Title: Re: How can I add a document property and populate it based on a cvs file
Post by: Phil Harvey on February 19, 2016, 03:13:29 PM
If they are in subfolders, then the proper path must appear in the SourceFile column.  Also, you would need to add the -r option.

- Phil