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.

  1. Start with a fresh action.
  2. Set the action type to “rename files or folders”.
  3. Set “what to rename” to “file names only”.
  4. Set “filter files” to “require one terms to match”. Leave the search type as “regular expression”.
  5. 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.
  6. In the main part of the action, enter the regex .* to match the file’s whole name, whatever it is.
  7. 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.
  8. Tick the extra processing checkbox. An additional set of controls for entering search terms appears.
  9. 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.
  10. Leave the extra processing replacement blank so invalid characters are deleted.
  11. 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”.