Setup CSV keyword import where filenames are [filename(-7)] or [basename(-3)]

Started by tdunk, May 01, 2024, 11:02:08 AM

Previous topic - Next topic

tdunk

Hello all- Newb here renaming and downloading thousands of attachments from database- I have a renaming formula and action that adds index number to end of filenames. Can I get exiftool to match everything in a filename subtracting the extension and index-- in this case _01.jpg and matching keywords to the preceding string in the filename? ex filename is "Zelle_MIA-IKE-600_2023-11-20_016571_01.jpg". Alternately I was considering parsing the filename to keywords- in these cases i would need the first two strings and the year for keywords. Is one method easier/better?

StarGeek

I'm sorry, I don't understand.  All I can get is that there is a CSV involved somehow, and you want to change a filename from
Zelle_MIA-IKE-600_2023-11-20_016571_01.jpg
to
Zelle_MIA-IKE-600_2023-11-20_016571
* 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).

tdunk

My apologies for the poor explanation. I would like to use csv to import keywords for a few thousand assets, many are repeats of filename with only last two digits differing as a file index. From what i've been able to find its a 1:1 match for exact filename to keywords to use csv import. So from example above, there may be Zelle_MIA-IKE-600_2023-11-20_016571_01.jpg, Zelle_MIA-IKE-600_2023-11-20_016571_02.jpg, Zelle_MIA-IKE-600_2023-11-20_016571_03.jpg. I would like to be able have one listing in csv for Zelle_MIA-IKE-600_2023-11-20_016571 (without index) and attach keywords to all files with Zelle_MIA-IKE-600_2023-11-20_016571_[01,02,03, etc.]. Does that make it clearer?

StarGeek

Ah, ok.

Unfortunately, no. Using the -csv option, you have to either use the actual file name or you can use an * to apply the CSV to all files.  It is not a wildcard and can't be used for a partial name.
* 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).

tdunk

Thank you! Off to regex to pull keywords from the filename then.