I have a list of filenames containing country codes, for example:


I'm looking to rename them based on the country code to:

File1_BG.srt becomes Facebook.BG_bg.srt
File1_CS.srt becomes Facebook.CS_bg.srt
  • 2
    There are a lot of renaming questions on this site, some are listed in the Related section at right. What have you tried so far? Are you looking for a command-line or a UI solution?
    – nohillside
    Jan 8 at 15:49
  • Also, are they really named File1_, File2_? If not please replace with the real names of the files.
    – nohillside
    Jan 8 at 17:13
  • I have a list of filenames... What sort of a list? A text file: CSV, TSV, JSON, etc?? And are you looking to change the filenames only in your list - or do you want to change actual filenames as they are in your file system?
    – Seamus
    Jan 8 at 22:01

From the Finder, select all the files you want to rename, and under the file menu select rename. This brings up a pane with options to rename. For your files, you can put .srt in the find box and replace with _bg.srt. Then you can replace 'File1' with 'Facebook'. This will quickly rename the files for you. Looking around the rename panel, under the first pulldown on the left is the option to reformat. This option may come in handy as well.


Yes I can. I use hazel app for things like this.

I also know bash and zsh and python, but for quick hits a graphical tool is so much better. Especially with undo if you make a big mistake. If you’re new to scripting be sure you have time machine set up and run before you test a new script to fix things when more files than you expected get renamed in a way you didn’t expect.

  • 1
    Hazel looks awesome! I'm going to check it out! - A Better Finder Rename is my go-to app for large operations, and it does way, way more than rename files/folders. There's even a free trial!
    – IconDaemon
    Jan 8 at 16:48
  • 1
    Hazel is awesome. Not sure how easy it is to get the renaming done the OP is asking for.
    – nohillside
    Jan 8 at 17:11
  • I would encourage that addition - I need to test a few of these on my M1 mini and have a quiver of three tools to recommend. Hazel just is my go to tool so far on Big Sur and Apple Silicon so I know it’s the latest and will work on older Macs too.
    – bmike
    Jan 8 at 17:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .