An iTunes error (documented in this AskDifferent thread) has left my library folders full of duplicate files, but with different extensions. Over time, when I have found an album that iTunes can't find I have deleted the local files and downloaded from iCloud. This has left me with the downloaded m4a files but also the original 'lost' mp3's - the files were never actually missing, but the links in the iTunes database were corrupted somehow.
I could delete the entire local library and then download from iTunes Match/iCloud but it's a very large library and this could take many days on my internet connection.
Trying to convert the 'known' mp3's to m4a's and deleting any left over 'lost' mp3's would take far too long.
Could a terminal command or applescript search within a folder and match identical base file names but different mp3 and m4a extensions and then delete the corresponding mp3 file when found? It would need to do this recursively down into each folder and sub-folder within the music folder.