ExifTool Forum

ExifTool => Newbies => Topic started by: slickdawg on August 25, 2021, 04:03:22 PM

Title: Rename file if Software tag is populated
Post by: slickdawg on August 25, 2021, 04:03:22 PM

I'm trying to identify all .jpg files that have been "contaminated" by the Microsoft Photo viewer.  I don't want to add all of that tag to the filename, just add microsoft to the file name if the tag is populated.


Software                        : Microsoft Windows Photo Viewer 6.1.7600.16385

so IMG_0001.JPG would become IMG_0001_Microsoft.JPG

I was going to do this with grep and a bash script, but I think exiftool would be better.  Any suggestions? 
Title: Re: Rename file if Software tag is populated
Post by: StarGeek on August 25, 2021, 04:33:55 PM
Try
exiftool -if "$Software=~/Microsoft Windows Photo Viewer/" -Filename=%f_Microsoft.%e /path/to/files/

Change the double quotes to single quotes if you're using Mac/Linux/Powershell.
Title: Re: Rename file if Software tag is populated
Post by: slickdawg on August 26, 2021, 08:02:41 PM

Thank you StarGeek!  That worked perfectly, unlike my trials.  :)