TransWikia.com

Can you batch rename files if they contain certain criteria?

Ask Different Asked by mugawump on January 30, 2021

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

File1_BG.srt
File2_CS.srt

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 Answers

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.

Answered by jmh on January 30, 2021

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.

Answered by bmike on January 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP