Can I reset all keywords to Proper Capitalization (First Character capitalized)

Started by E_Rap, March 15, 2022, 08:36:55 PM

Previous topic - Next topic

E_Rap

I have hundreds of redundant keywords with some in all lower case, some in mixed case and some in upper case.

Is there a way to reset all keywords to proper case (first letter capitalized)?

As I plan on using a statement like the one below, but seek an option for proper case:
exiftool -sep '//' '-keywords<${keywords;$_=lc}' DIR

StarGeek

Are they all just a single keyword?  Or do you have a "keyword" which is multiple keywords where each would be capitalized, e.g. New York City?  What about words such as names that would have a capital in the middle, e.g. McDonald.

This command will upper case the first letter and lower case the rest for all words in a single "keyword".  It also avoids all the mucking about with the -sep option.
exiftool -api "Filter=s/(\S+)/\u\L$1/g" -TagsFromFile @ -Subject -Keywords /path/to/files/

C:\>exiftool -G1 -a -s -subject y:\!temp\Test4.jpg
[XMP-dc]        Subject                         : TEST ONE, test two, tEST tHREE

C:\>exiftool -P -overwrite_original -api "Filter=s/(\S+)/\u\L$1/g" -TagsFromFile @ y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -G1 -a -s -subject y:\!temp\Test4.jpg
[XMP-dc]        Subject                         : Test One, Test Two, Test Three
* 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).

E_Rap