Rename Audio Files Using Meta Data
Once you have the File Selector set up to search through audio files, you can use PowerGREP to rename your audio files using some of the meta data such as the name of the artist and the title of the song.
- Start with a fresh action.
- Set the action type to “rename files or folders”.
- Set “what to rename” to “file names only”.
- Set “filter files” to “require one terms to match”. Leave the search type as “regular expression”.
- For filtering files, enter the regex \A *Title: (?'title'\V+)\R *Artist: (?'artist'\V+) to capture the Title and Artist tags, which PowerGREP always lists first in that order. The named capturing groups carry over to the remainder of the action.
- In the main part of the action, enter the regex .* to match the file’s whole name, whatever it is.
- As the replacement, enter ${artist} - ${title}.%FILEEXT% to replace the file’s name with the artist and title captured from the file’s contents along with the file’s original extension.
- Tick the extra processing checkbox. An additional set of controls for entering search terms appears.
- Use [\\/:*?"<>|] as the regular expression for extra processing. This regex matches any character that is not allowed in file names by the Microsoft Windows operating system.
- Leave the extra processing replacement blank so invalid characters are deleted.
- Set the backup file options as you like them.
Should a file not have a song title or artist name in its meta data, then the regex we’re filtering files with will fail to match. That file is thus filtered out from the action and won’t be renamed.
This action is available in the PowerGREP5.pgl library as “Media: Rename audio files using meta data”.