Release of nomenus-rex 0.4.0, a utility for bulk file renaming

A new version of the Nomenus-rex console utility for mass file renaming is available. The program is written in C++ and distributed under the terms of the GPLv3 license. The rules for renaming are configured using the configuration file. For example: source_dir = "/home/user/work/source"; destination_dir = "/home/user/work/destination"; keep_dir_structure=false; copy_or_rename = "copy"; rules = ( { type = "date"; date_format = "%Y-%m-%d"; }, { type = "text"; text = "_"; }, { type = "dir"; // mode = "whole path"|"parent dir only" mode = "whole path"; separator = "-"; }, { type = "text"; text = "_"; }, { type = "integer"; // mode = "global"|"local at every dir" mode = "local at every dir"; start = 0; step = 1; padding = 5; }, { type = "extension"; // leave the "ext" variable empty to use an original extension ext = ""; // mode = "lowercase"|"uppercase"|"sic"; mode = "lowercase"; } );

Using the specified settings, the utility will rename the file "/home/user/work/source/TestDir2/file2.txt" to "/home/user/work/destination/2022-03-16_TestDir2_0.txt". The utility also knows how to work with the HOME and XDG_CONFIG_HOME directories (where it searches for a configuration file if the full let is not specified for it) and understands the abbreviation "~" for referring to the home directory.

Changes in the new version:

  • A new kind of "rules" has been added that takes the current unfinished name as a parameter. This allowed us to add a replace rule that replaces all occurrences of a substring with a new string.
  • Filenames are now sorted alphabetically before processing. Previously, files were processed in the order they were served by the file system. In the next version, this sorting will become user-controlled.
  • The documentation has been slightly revised to make it more convenient.
  • Internal changes in the code (beginning of creating tests and a new template function for reading enum variables from a configuration file) that are designed to simplify the addition of new rules and reduce the number of new errors.

Source: opennet.ru

Add a comment