PecoRename icon

PecoRename
for Haiku


Using PecoRenameConflicting RenamesRenamimg Modes
Tips & TricksDownloadBugreports & FeedbackThanksHistory



PecoRename is a utility to rename a batch of files according to a customized pattern. It renames files in many different ways: Add a file extension, number files in order, search and replace, and more…

index Using PecoRename

Renaming can be initiated in two ways: Either the accompanying Tracker add-on is invoked on the selection of files that are to be renamed. Or PecoRename is launched and the files drag & dropped onto it or added from a file dialog by clicking on the folder icon.

PecoRename currently only works on files that are in the same folder.

PecoRename and its add-on

Four selected files are opened in PecoRename via the Tracker add-on. There, "Main" is inserted at the start of each file name.

Then the mode of renaming is chosen from the pop-up menu below the list of files. More on the available renaming modes below.

The Preview column of the file list will display the new file names while you create and tweak the renaming pattern with the various widgets of the chosen rename mode. If the preview column of a file is empty, it means it doesn't fit the pattern and therefore isn't renamed.

At the bottom left of the file list is a status area that shows the total number of "items" in the list, how many of them fit the pattern ("renames"), and only when applicable, the number of conflicting renames ("duplicates"), see "Conflicting Renames" below".

Clicking Rename will immediately start renaming ALL files in the list!
If you decide that some of them should not be renamed, you have to remove them from the list first. Either by right-clicking and choosing Remove or selecting a file and pressing DEL.

index Conflicting Renames

Conflicting renames

Replacing "View" with "Window" would create duplicates of the already existing "Window.cpp" and "Window.h".

Conflicts arise if the renaming pattern would result in new file names that would clash with each other. In that case, the proposed new file name in the preview column is displayed in red and you see a count of duplicates in the status area at the bottom left of the file list.

These conflicting renames won't be performed, of course.


There's another possibility of conflict:
There may already exist files with the same names as the targeted new file names that were not selected to be processed by PecoRename.

Those won't be shown as red in the preview, because PecoRename will encounter them only during processing after pressing Rename. Instead, a Report window will pop up, after all possible renamings are finished:

Conflicting report

"MainWindow.cpp" and "MainWindow.h" were already present in the folder: 2 files couldn't be renamed.

These conflicting renames haven't been performed, of course.

index Renaming Modes

The renaming modes are all pretty much self-explanatory. But see further down for some background on the Random symbols and Add file extension modes.

Basically, you construct your pattern like you would read a sentence, choosing options and entering text for the variables that define the new file names. The preview always shows if you're still on the right track.

Click on the screenshot below, to click through examples for every renaming mode.

Rename mode 'Search / replace'

Click on the image to see the next example.

Random symbols

You can insert or overwrite with a number of random symbols. The checkmarks define what kind of symbols are used: Upper/Lower case, Numbers, Symbols (!@#$%^&*).
Custom lets you define your own set of symbols. For example, you could disable all other checkboxes and enter "1234" in the text field, and the inserted characters will only be a randomized selection of those four numbers.

Add file extension

In this rename mode, PecoRename tries to find the correct file extension to append to each file. This will not always work as desired, however, so it's important to understand how it works:

Haiku marks every file with a so-called MIME type. If you get a file from a non-Haiku environment the new file's MIME type has to be identified. For this, Haiku uses different recognition mechanisms and ‒ as a last resort ‒ the file extension.

PecoRename goes the reverse way: For the given MIME type of a file, it fetches the corresponding extension. Those are set in Haiku's FileTypes preferences.

For PecoRename to do a good job at this, two conditions have to be met:

  1. The file must have its MIME type set

    If you are not sure if Haiku has already recognized a file, you can do this in Tracker: Right-click the file and choose Identify. This only works on BFS formatted devices.

  2. There must be an extension set for the file's MIME type

    You can set and adjust the file extensions in Haiku's FileTypes preferences.
    PecoRename always uses the first extension found. Because of this, you may get a non-desired extension like .jpeg instead of .jpg, or .mp2 instead of .mp3 until you change the order.

index Tips & Tricks

index Download

PecoRename is directly available through HaikuDepot from the HaikuPorts repository. You can also build it yourself using Haikuporter. The source is hosted at GitHub.

index Bugreports & Feedback

Please use PecoRename's issue tracker at GitHub if you experience unusual difficulties.
If you'd like to contribute translations, please do so by logging into the Polyglot site with your GitHub account.

index Thanks

PecoRename was originally coded for the BeOS by Werner Freytag ("Pecora") and was released under a MIT license in 2009.
Thanks to everyone contributing code, translations and feedback.

index History

2.1 - 2023-10-26:

2.0.3 - 2018-08-18:

2.0.2 - 2018-08-18:

2.0.1 - 2018-08-18:

2.0 - 2018-03-18:

1.5 - 2016-03-15:

0.9 - BeOS era: