Menu

Tree [eb37d3] main v2.11 /
 History

HTTPS access


File Date Author Commit
 external 2024-09-08 Andy Xuming Andy Xuming [32d734] Added the link to libregex in MinGW32
 m4 2024-08-29 Andy Xuming Andy Xuming [6907f6] Build system updated.
 .gitignore 2024-09-05 Andy Xuming Andy Xuming [b18c79] configure file updated for Msys2/Cygwin
 COPYING 2011-08-31 Andy Xuming Andy Xuming [089c33] Initial commit the rename project
 ChangeLog.txt 2024-10-01 Andy Xuming Andy Xuming [14d7ec] Ready to release.
 Makefile.am 2024-10-14 Andy Xuming Andy Xuming [98b37e] Fixed the release process in the build system.
 Makefile.in 2024-10-14 Andy Xuming Andy Xuming [98b37e] Fixed the release process in the build system.
 README.md 2024-10-14 Andy Xuming Andy Xuming [eb37d3] Updated the README.
 aclocal.m4 2024-08-29 Andy Xuming Andy Xuming [6907f6] Build system updated.
 autotest.sh 2016-07-18 Andy Xuming Andy Xuming [cc93ea] Updated the libcsoup to 0.8.20. Updated the aut...
 compile 2024-08-20 Andy Xuming Andy Xuming [208dae] Fixed the autoconf failed to find the regular f...
 config.guess 2017-04-13 Andy Xuming Andy Xuming [bc0e78] Moved to autotool based build system.
 config.h.in 2024-09-28 Andy Xuming Andy Xuming [94c200] Still doing the pre-built libraries.
 config.sub 2017-04-13 Andy Xuming Andy Xuming [bc0e78] Moved to autotool based build system.
 configure 2024-10-14 Andy Xuming Andy Xuming [98b37e] Fixed the release process in the build system.
 configure.ac 2024-10-14 Andy Xuming Andy Xuming [98b37e] Fixed the release process in the build system.
 install-sh 2017-04-13 Andy Xuming Andy Xuming [bc0e78] Moved to autotool based build system.
 main.c 2024-08-13 andy xuming andy xuming [a8415d] Updated the readme file.
 missing 2017-04-13 Andy Xuming Andy Xuming [bc0e78] Moved to autotool based build system.
 mmgui.c 2024-08-13 andy xuming andy xuming [a8415d] Updated the readme file.
 mmrc_icon_dialog.h 2016-07-05 Andy Xuming Andy Xuming [16cd48] Inputs for GUI.
 mmrc_icon_error.h 2016-07-21 Andy Xuming Andy Xuming [6229c7] Added the function to analysis filenames.
 mmrc_icon_info.h 2016-07-21 Andy Xuming Andy Xuming [6229c7] Added the function to analysis filenames.
 mmrc_icon_warning.h 2016-07-14 Andy Xuming Andy Xuming [3a4c8d] Added an icon for warning dialog
 rename.c 2021-03-31 Andy Xuming Andy Xuming [9c0826] Fixed the wrong number of command line paramete...
 rename.h 2017-04-13 Andy Xuming Andy Xuming [bc0e78] Moved to autotool based build system.
 rename.ico 2016-07-11 Andy Xuming Andy Xuming [b06726] Initial the Win32 version.
 rename.nsi 2024-09-06 Andy Xuming Andy Xuming [10a19a] Updated the automake files for Windows.
 rename_icon.rc 2016-07-12 Andy Xuming Andy Xuming [bd93e1] Autotest script updating.
 renamex.1 2018-11-22 Andy Xuming Andy Xuming [6e0a8d] Fixed a small issue in Makefile and updated the...
 renamex.desktop 2024-08-13 andy xuming andy xuming [a8415d] Updated the readme file.
 renamex.lsm 2024-10-01 Andy Xuming Andy Xuming [14d7ec] Ready to release.
 renamex.pdf 2018-11-22 Andy Xuming Andy Xuming [6e0a8d] Fixed a small issue in Makefile and updated the...
 winxp.sh 2024-09-28 andy andy [7cbb86] Added a script to help prepare the config.h.in ...

Read Me

Rename Express

Rename Express is a powerful tool designed for renaming files in bulk.
It efficiently handles mass quantities of files, allowing you to batch change,
lowercase, uppercase with ease.
This lightweight tool, written in C, delivers faster performance than most
renaming tools built with shell scripts.

Powered by regular expressions, Rename Express enables advanced search and
substitution of string patterns across large file sets.
It supports both MS Windows and Linux/Unix platforms, and includes a portable
GUI front-end for user-friendly operation.

Features

  • directly search and replace substrings within filenames
  • using regular expression to search and replace sub-strings within filenames
  • convert filenames to uppercase or lowercase
  • fast renames large quantities of files
  • recursively processing directories and subdirectories
  • supports renaming by reading filenames from a file
  • dry run mode: preview the results before making any changes
  • support MS Windows and Linux/Unix
  • support both CLI and GUI mode

Build in Linux

Clone the source code from the repo, for example:

git clone https://github.com/xuminic/renamex.git
cd renamex

Or download the release package:

wget https://master.dl.sourceforge.net/project/rename/renamex-2.7.tar.bz2
tar jxf renamex-2.7.tar.bz2
cd renamex-2.7

Using the default configuration:

./configure
make

Depending on your system, if the libgtk_dev has been installed, it builds the
runtime with the GUI function. Otherwise it would build a CLI tool only.

To build the rename express with GUI, the following dependencies are required:

  • libgtk-3-dev

or

  • libgtk2.0-dev

The dependencies can be recognized by the output of configure, for example:

...
checking pkg-config is at least version 0.9.0... yes
checking for GTK... yes
configure: gtk+-3.0 found
checking for IupOpen in -liup... no
configure: The libiup will be built soon.
...

If both libgtk-3-dev and libgtk2.0-dev were installed, the libgtk-3-dev will
be prioritized by default, unless manually overriden by:

./configure
USE_GTK2=1 make

which would link the libgtk2.0 instead.

If you wish to build a CLI only program even if the libgtk_dev had been installed,
you may use the --with-gui option:

./configure --with-gui=no
make

Or make a command line only tool:

SYSGUI=CFG_GUI_OFF make

Build in Windows

Windows 10 and higher (todo)

  1. Install MSYS2 (the build system and command line console)

  2. Install tool chains

Install tool chains for MINGW32/MINGW64/UCRT:

pacman -S mingw-w64-i686-gcc mingw-w64-x86_64-gcc mingw-w64-ucrt-x86_64-gcc
pacman -S mingw-w64-i686-gdb mingw-w64-x86_64-gdb mingw-w64-ucrt-x86_64-gdb
pacman -S mingw32/mingw-w64-i686-nsis ucrt64/mingw-w64-ucrt-x86_64-nsis
  1. Build the program

For example in MINGW32, using the default configuration:

git clone https://github.com/xuminic/renamex.git
cd renamex
./configure
make

When successful the build process would generate two executable files and
one install directory, for example:

renamex.exe
renamex_win.exe
renamex-2.11-win32-bin

where renamex.exe is a command line tool and renamex_win.exe is a Windows program.
All executable program and documents are grouped in the renamex-2.11-win32-bin folder.
Rename Express uses the native Windows API only so these executable programs are "green"
and portable, can be moved to anywhere to run.

  1. Generate the Windows Installer (Optional)

Though the Rename Express is "green" and portal, it can still generate a traditional
Windows Installer by NSIS. Using this command:

make installer-win

it will generate a file like renamex-2.11-win32-setup.exe.

Windows 7

  1. Install MSYS2 (the build system and command line console)

MSYS2 does no longer support Windows 7. The
2022-10-28
is the last version for Windows 7. Install this version with required tools.

  1. Lock the runtime

After installation of the 2022-10-28, first thing is to lock the
msys2-runtime under 3.4.10-2. Otherwise any upgrade or installation might introduce
the DLLs which Windows 7 can not link.

Run this command, but do NOT update anything, simply cancel the update.

pacman -Syu      # DO NOT DO UPDATE. Let it receive the metadata then quit; that's all

then upgrade the msys2-runtime to 3.4.10-2:

pacman --noconfirm -S msys2-runtime-3.4 msys2-runtime-3.4-devel
  1. OpenSSH

The OpenSSH 9.8 in MSYS2 2022-10-28 was very broken.
It kept seeking a nonexistent file msys_cryto_3.0.dll.
Extracting the msys_cryto_3.0.dll from higher version won't help.
The ssh stop complaining the DLL yet display nothing instead.
The only workaround for me was rolling back to 9.1p1-1:

pacman -Rdd openssh
wget https://repo.msys2.org/msys/x86_64/openssh-9.1p1-1-x86_64.pkg.tar.zst
pacman -U openssh-9.1p1-1-x86_64.pkg.tar.zst
  1. DO NOT UPDATE

Since fixed the runtime and openssh version, make it secure by being ignored in package
list. Edit the /etc/pacman.conf:

IgnorePkg = msys2-runtime openssh

Note that updating via pacman -Syu is doable now, but it breaks many packages.
So better avoid doing it.

  1. Install tool chains

Install tool chains for MINGW32/MINGW64/UCRT:

pacman -S mingw-w64-i686-gcc mingw-w64-x86_64-gcc mingw-w64-ucrt-x86_64-gcc
pacman -S mingw-w64-i686-gdb mingw-w64-x86_64-gdb mingw-w64-ucrt-x86_64-gdb
pacman -S mingw32/mingw-w64-i686-nsis ucrt64/mingw-w64-ucrt-x86_64-nsis
  1. Build the program

For example in MINGW32, using the default configuration:

git clone https://github.com/xuminic/renamex.git
cd renamex
./configure
make

When successful the build process would generate two executable files and
one install directory, for example:

renamex.exe
renamex_win.exe
renamex-2.11-win32-bin

where renamex.exe is a command line tool and renamex_win.exe is a Windows program.
All executable program and documents are grouped in the renamex-2.11-win32-bin folder.
Rename Express uses the native Windows API only so these executable programs are "green"
and portable, can be moved to anywhere to run.

  1. Generate the Windows Installer (Optional)

Though the Rename Express is "green" and portal, it can still generate a traditional
Windows Installer by NSIS. Using this command:

make installer-win

it will generate a file like renamex-2.11-win32-setup.exe.

Windows XP (32-bit)

  1. Install MinGW (the build system and command line console)

Download the installer which still supports Windows XP from
MinGW - Minimalist GNU for Windows Files
and install everything within.

  1. Install Git

Download Git from
Git for Windows 2.10.0
and install it.

  1. Install NSIS (Optional)

NSIS is used to generate the Windows Installer for distributing the software.
Download NSIS from
NSIS: Nullsoft Scriptable Install System.
Not sure what the highest version for Windows XP. At least my 2.46 worked fine.

  1. Export the environment variable for Windows XP

To build the Rename Express in the MinGW console, the MSYSTEM need to be set to MINGWXP

export MSYSTEM=MINGWXP
  1. Prepare the config.h.in

The gawk 3.1.7 in MinGW seems not handling the CRLF line ends very well.
The configure generates invalid config.h.
The workaround is to pre-process the files with dos2unix.

git clone https://github.com/xuminic/renamex.git
cd renamex
dos2unix config.h.in
dos2unix external/regex-20090805/config.h.in
  1. Build the program

Using the default configuration:

./configure
make

When successful the build process would generate two executable files and
one install directory, for example:

renamex.exe
renamex_win.exe
renamex-2.11-win32-bin

where renamex.exe is a command line tool and renamex_win.exe is a Windows program.
All executable program and documents are grouped in the renamex-2.11-win32-bin folder.
Rename Express uses the native Windows API only so these executable programs are "green"
and portable, can be moved to anywhere to run.

  1. Generate the Windows Installer (Optional)

Though the Rename Express is "green" and portal, it can still generate a traditional
Windows Installer by NSIS. Using this command:

make installer-win

it will generate a file like renamex-2.11-win32-setup.exe.

The Pre-built Packages and Installers

  • renamex-*.*-src-all.tar.bz2: the source code tar ball with every dependencies included; can be built without Internet.
  • renamex-*.*-src.tar.bz2: the source code tar ball with Github dependencies
  • renamex-*.*-win32-bin.zip: the executable files package for 32-bit Windows, Windows 7 and above
  • renamex-*.*-win32-setup.exe: the installer for 32-bit Windows, Windows 7 and above
  • renamex-*.*-win64-bin.zip: the executable files package for 64-bit Windows, Windows 7 and above
  • renamex-*.*-win64-setup.exe: the installer for 64-bit Windows, Windows 7 and above
  • renamex-*.*-winxp-bin.zip: the executable files package for Windows XP, 32-bit
  • renamex-*.*-winxp-setup.exe: the installer for Windows XP, 32-bit

Build from source code

Currently the Rename Express can be built with MinGW32 and MinGW64.
UCRT64 and Cygwin are not supported yet.

Clone the source code from the repo, for example:

git clone https://github.com/xuminic/renamex.git
cd renamex

Or download the release package:

wget https://master.dl.sourceforge.net/project/rename/renamex-2.7.tar.bz2
tar jxf renamex-2.7.tar.bz2
cd renamex-2.7

Using the default configuration:

./configure
make

By default the build process would generate two executable files and
one install directory, for example:

renamex.exe
renamex_win.exe
renamex-2.11-win32-bin

where renamex.exe is a command line tool and renamex_win.exe is a Windows program.
Rename Express uses the native Windows API only so these executable programs are "green"
and portable, can be moved to anywhere to run.

Examples

To lowercase all files' names recursively.

renamex -l -R *

Substitute all 'abc' substrings appeared in C sources files with
'xyz', ignoring the case, then uppercase the whole file name.

renamex -u -s/abc/xyz/gi *.c

Find all files with the '.c' suffix in the current directory and change
them to '.cpp' suffix. Print the verbose information.

renamex -v -s/.c/.cpp/e *

Find all files with the '.c' suffix under the current directory and change
them to '.cpp' suffix by the list file.

find . -name *.c > filename.lst
renamex -s/.c/.cpp/e -f filename.lst

Read names from the 'filename.lst', find the last occurrence of 'abc'
and replace it with '12345', ignoring the case.

renamex -s/abc/12345/bi *

The target substring starts with a capital letter, and ends with string
'file'. There are 0 or any numbers of characters between the capital letter
and 'file'. The substring, if encountered in filenames, will be replaced
with 'nofile'.

renamex -s/^[A-Z].*file/nofile/r *

Similar to above, except it uses extended regular expression, such as
the '+' metacharacter, and replaces all matching strings with 'nofile'.

renamex -s/^[A-Z].+file/nofile/xg *

Test mode only. Simulate the rename process but no files would be
actually changed.

renamex -t -s/^[A-Z].+file/nofile/xg *
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.