ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: daveb30 on February 02, 2024, 05:20:00 PM

Title: Find partial match
Post by: daveb30 on February 02, 2024, 05:20:00 PM
I would like to search a directory for files that have a partial metadata match.
I can use the following and get a valid response.  However, I would like to search for a partial match and not an exact match.  I would also like the partial match to be anywhere in the metadata (not required to be at the beginning).
exiftool -if "$AlbumArtistSort eq 'Abair, Mindi'" -p "$directory/$filename" -ext flac -r "x:\flac" >found.txt

An added benefit would be if I could search multiple tags with the same command (say... AlbumArtistSort &  AlbumArtist)

Thanks
Dave
Title: Re: Find partial match
Post by: StarGeek on February 02, 2024, 07:30:24 PM
You would use regular expression match.  Something like
exiftool -if "$AlbumArtistSort=~/Abair, Mindi/ or $AlbumArtist=~/Abair, Mindi/" -p "$directory/$filename" -ext flac -r "x:\flac" >found.txt
Title: Re: Find partial match
Post by: daveb30 on February 02, 2024, 09:23:20 PM
Thank you StarGeek :)