ホーム 暮らし Super Easy! 3 Ways to Batch Rename Files on Mac

Super Easy! 3 Ways to Batch Rename Files on Mac

藤崎 健人 藤崎 健人 • 更新: • 公開: • 読了約 14 分
目次

Do you find that the number of files, such as Excel sheets, documents, and images, keeps increasing before you know it? You might have ended up with inconsistent file names as well. When you look back later, you might get confused, wondering, "Wait, where is xxx?" or "Which file is this?" You want to organize your files, but doing it one by one is time-consuming, prone to errors, and honestly quite a hassle.

Here, we will introduce 3 ways to batch rename files on Mac. If you want to manage your files efficiently, be sure to keep reading. By simply batch-renaming multiple files with sequential numbers or automatically changing file names, you can organize them including dates and extensions, keeping your files neatly managed.

tl;dr

nd5f829b7b23b

There are three ways to change file names (sequential numbers, extensions, dates, names) on a Mac.

  • Finder: The easiest and most user-friendly method. Great for Mac beginners.

  • Command (Terminal): Complex and requires some coding knowledge. Since changes cannot be undone, please operate with caution.

  • Automator: Once set up, it can be reused. Since it cannot be undone, please create a copy before executing.

How to batch rename files using Finder's rename feature

Macs come equipped with the Finder app. By using the rename feature in that app, you can add sequential numbers, replace specific characters, change extensions, and add dates.

Select files in bulk and click the rename feature to change file names all at once.

  • "Replace Text", "Add Text": Change the text of the file

  • "Format": Add numbers to the file name and add dates

Add text to file names

Select multiple files, right-click, and click "Rename".
Next, select "Add Text", enter the text you want to add, and set the position.
Finally, click "Rename" to add the text to the file names.

After adding text to file names

Add numbers to file names

Similar to the procedure for adding text to file names, first select the files and enter the screen shown below. There, select Format and configure it as needed.

After adding numbers to file names

Name and Counter

Name and Counter is for adding sequential numbers like 00001 to the beginning or end of file names, or for renaming files.

After changing Name and Counter

Change/Add Name and Date

This is for renaming files or adding dates in a format like Year-Month-Day-Hour-Minute-Second. For example,

After changing/adding Name and Date

How to batch rename files on Mac using commands (Terminal)

Using commands allows you to process tasks like adding sequential numbers, replacing specific characters, or changing extensions all at once, making it very efficient when handling a large number of files.

I personally performed file renaming using commands for the first time, so I worked while researching various materials. I would like to share what I learned during that process with you all.

Step 1: Open the folder containing the files you want to rename.

Step 2: Right-click the folder path at the bottom of the window and select "Open in Terminal".

Step 3: For example, if you want to change relatedQueries.csv in the folder to GoogleTrendData_Number.csv, copy and execute the following command in the Terminal.

a=1; for i in relatedQueries.csv; do num=$(echo "$i" | grep -o '[0-9]\+'); new=$(printf "Google Trendデータ_%02d.csv" "$num"); mv -- "$i" "$new"; a=$((a+1)); done

After execution

If you need a space in the name, press the space key directly to insert a space.

How to batch rename Mac files with Automator

You can also batch rename files by using the Automator feature, which automates tasks on Mac.

Step 1: Press the Command key, copy and paste Automator, and launch it. Step 2: Select Application.

Step 3: Select "Rename Finder Items" from Actions and drag it to the right.

Step 4: Select "Don't add" from the alert and click it.

If you add it, a copy of the file will also be created. When using it for the first time, you can also click and select this "Add" option.

Step 5: Select the change type as needed. Here, we will try to change the file extension on Mac. Select "extension only" and enter the text string.

Step 6: Press the Command and S keys to save it as an application with a name. Drag and drop the files you want to change onto the app, and they will be changed.

Once saved as an application, you can use it every time.

If you select "Replace Text", you can only execute it on one file at a time. If you execute it on multiple files, the following error message will appear.

Frequently Asked Questions and Answers

How can I batch rename multiple files on Mac?
There are three ways to batch rename files on Mac: Finder, commands, and Automator.

  • Finder: The easiest and most user-friendly method. It works well for Mac beginners.

  • Command (Terminal): Complex and requires some coding knowledge. Suitable for advanced users.

  • Automator: Once set up, it can be reused later.

Once you execute any of these methods, they cannot be undone. Please create a copy before running them.

How do I batch rename multiple files and add a sequential number to the beginning?
The easiest ways are using Finder's format function and Automator. For the format function, use 'Name and Index' to add sequential numbers like 1, 2, 3. Use 'Name and Counter' to add sequential numbers like 00001, 00002, 00003.

What apps can batch rename files on Mac?
Apps for batch renaming files on Mac include Apple's built-in app, Automator, and third-party apps like NameChanger.

同じカテゴリの記事

藤崎 健人

芸能取材歴10年のデスク。所属事務所の公式リリース、番組公式サイト、配信サービスの告知を一次情報として採用し、裏付けの取れない内容は記事にしていません。

おすすめの関連記事