A CLI utility for the file mass-renaming

─────────────────┨ What is this? ┠─────────────────

Nomenus-rex is a CLI utility for the file mass-renaming.

─────────────────┨   Installing  ┠─────────────────
You can download the source from the GitHub:

git clone https://github.com/ANGulchenko/nomenus-rex.git

Nomenus-rex was created to be assembled with CMake, so just run these commands
from the directory with CMakeLists.txt:

cmake ./
make

─────────────────┨  How to use?  ┠─────────────────

Nomenus-rex is a typical CLI (command line interface) utility and has such
parameters:

 -h  --help          Prints short help
 -s  --source        sets the path to the source directory
 -d  --destination   sets the path to the destination directory
 -c  --config        sets the path to the configuration file
 -y  --yes           Process files without confirmation

The only mandatory parameter is "-c"/"--config". Source and destination paths
can be omitted if they're present in the configuration file. If paths are set in
the command line and in the configuration file then command-line data has higher
priority.
It is possible to use "~" char if you have a "HOME" environment variable set
in your system. Also you can omit the full path to the config file. In this case
the config would be searched in XDG_CONFIG_HOME/nomenus-rex/ directory or
(in the case of the absense of XDG_CONFIG_HOME environment variable) in the
HOME/.config/nomenus-rex/

Here is an example of the configuration file (decorative borders aren't
included):

─────────────────┨ Start config ┠─────────────────

source_dir = "/home/user/work/source";
destination_dir = "/home/user/work/destination";

keep_dir_structure = false;
copy_or_rename = "copy";
sort_mode = "az";

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";
    }
);

─────────────────┨  End config  ┠─────────────────

// is a single-line comment.
/*
  Multi-line comment.
*/

"Source/destination directories" are self-explanatory. You should make them
identical if you want to rename files, but not copy or move. It is possible
to use "~" char if you have a "HOME" environment variable set in your system.

"keep_dir_structure" can be true or false. While "false", no subdirectories are
created in the destination directory. "True" keeps the subdirectory structure
identical to the source.

"copy_or_rename" can be "copy" or "rename". In "copy" mode files are copying, in
"rename" they are renaming or moving.

"sort_mode" controls the sorting of the filenames before processing. Can be "sic"
for no sorting at all, "az" for ascending alphabetical sorting, and "za" for descending
alphabetical sorting.

"rules" is an array of small templates, each of which is responsible for a particle
of the resulting filename. These templates-rules are processed in the same order
as they are described in the "rules" array. For example, the aforecited config
will copy
"/home/user/work/source/TestDir2/file2.txt"
to something like
"/home/user/work/destination/2022-03-16_TestDir2_00000.txt"

Rules can be of this types:

  "date"     : date_format is the same as in STRFTIME(3)
             ────┨  Example  ┠────────────────
             {
                 type        = "date";
                 date_format = "%Y-%m-%d";
             }

  "text"     : just any text
             ────┨  Example  ┠────────────────
             {
                 type        = "text";
                 text        = "_";
             }

  "dir"      : mode "whole path" inserts the whole path with subdirs separated
               with "separator".
               mode "parent dir only" inserts only the nearest parent dir to
               the file.
               Only works with subdirectories to the source directory.
              ────┨  Example  ┠────────────────
              {
                  type        = "dir";
                  // mode     = "whole path"|"parent dir only"
                  mode        = "whole path";
                  separator   = "-";
              }

  "integer"  : inserts the number which starts from "start" and iterates with
               "step".
               "padding" dictates the length of the result: integer will be padded
               with zeros.
               mode "global" uses one counter for all files.
               mode "local at every dir" uses separate counters for ever subdir.
               ────┨  Example  ┠────────────────
               {
                   type        = "integer";
                   // mode     = "global"|"local at every dir"
                   mode        = "local at every dir";
                   start       = 0;
                   step        = 1;
                   padding     = 5;
               }

  "extension": inserts the file extension. By default, it uses the file's
               extension or you can provide your own extension through the "ext"
               variable.
               mode "lowercase" transforms the extension to lowercase.
               mode "uppercase" transforms the extension to uppercase.
               mode "sic" uses the original case.
               ────┨  Example  ┠────────────────
               {
                   type        = "extension";
                   // leave the "ext" variable empty to use an original extension
                   ext         = "";
                   // mode     = "lowercase"|"uppercase"|"sic";
                   mode        = "lowercase";
               }

  "filename" : mode "lowercase" transforms the filename to lowercase.
               mode "uppercase" transforms the filename to uppercase.
               mode "sic" uses the original case.
               ────┨  Example  ┠────────────────
               {
                   type        = "filename";
                   // mode     = "lowercase"|"uppercase"|"sic";
                   mode        = "lowercase";
               }

  "filesize" : the "dimension" can be "B","KiB","MiB", or "GiB".
               the dimension can be hidden with a help of "show_dimension" var.
               you can set any decimal separator. The dot wasn't a good idea because
               of the messing with file's extension.
               ────┨  Example  ┠────────────────
               {
                   type              = "filesize";
                   // dimension      = "B"|"KiB"|"MiB"|"GiB"
                   dimension         = "KiB";
                   show_dimension    = true;
                   decimal_separator = ",";
               }

  "replace"  : replaces all occurences of "what" substring to "to" substring.
               The replacement occurs in the current generating filename. For
               example, if you want to rename a "BlaBla001.txt" to "Ololo001.txt"
               you can use a "filename" rule first to set the current precessing
               filename into the "BlaBla001", then use "replace" rule with
               what="BlaBla" and to="Ololo" parameters and don't forget about
               extension rule in the end.
               ────┨  Example  ┠────────────────
               {
                   type        = "replace";
                   what        = "BlaBla";
                   to          = "Ololo";
               }


Similar Resources

File's sizes as a markdown table (CLI)

File's sizes as a markdown table (CLI)

Feb 6, 2022

Utility to convert any binary file into C source that can be compiled and linked to the executable.

bin2c Utility to convert any binary file into C source that can be compiled and linked to the executable. bin2o Utility to convert any binary file int

Jul 14, 2021

FSearch is a fast file search utility for Unix-like systems based on GTK+3

FSearch is a fast file search utility for Unix-like systems based on GTK+3

FSearch is a fast file search utility, inspired by Everything Search Engine. It's written in C and based on GTK3.

Jun 24, 2022

A lightweight utility for parsing PE file formats (EXE, DLL, SYS) written in C/C++

peParser A lightweight utility for parsing PE file formats (EXE, DLL, SYS). Windows Portable Executable (PE) files includes a variety of parsable data

Jun 15, 2022

High performance, easy-to-use, and scalable machine learning (ML) package, including linear model (LR), factorization machines (FM), and field-aware factorization machines (FFM) for Python and CLI interface.

High performance, easy-to-use, and scalable machine learning (ML) package, including linear model (LR), factorization machines (FM), and field-aware factorization machines (FFM) for Python and CLI interface.

What is xLearn? xLearn is a high performance, easy-to-use, and scalable machine learning package that contains linear model (LR), factorization machin

Jun 14, 2022

C++ lib and CLI for playing media files on a Chromecast

castr - a CLI and C++ library to cast media files to Chromecast devices using the built in Default Media Receiver

Jan 6, 2022

Class containing Anti-RE, Anti-Debug and Anti-Hook methods. Made for C++/CLI

Umium Class containing Anti-RE, Anti-Debug and Anti-Hook methods. Easy to use and easy to implement. Disclaimer This code has been made and optimized

Jun 11, 2022

Creating CLI's just got a whole lot better

 Creating CLI's just got a whole lot better

Staq Creating CLI's just got a whole lot better. Don't worry about CLI colouring, networking, Size of Executables, Speed ever again Have any doubts? R

Jun 1, 2021

Beryl-cli is a client for the BerylDB database server

Beryl-cli is a client for the BerylDB database server

Beryl-cli is a client for the BerylDB database server. It offers multiple commands and is designed to be fast and user-friendly.

Apr 21, 2022

CLI Application that provides the Freedesktop Secret Service using Pass as its backend!

pass-secrets CLI Application that provides the Freedesktop Secret Service using Pass as its backend! Status Currently working to store secrets with pr

Apr 7, 2022

Fegeya Freud, CLI FPaper renderer, based on Totem (`less`-like tool without `--help`)

Fegeya Freud, CLI FPaper renderer, based on Totem (`less`-like tool without `--help`)

Fegeya Freud, CLI FPaper renderer, based on Totem (`less`-like tool without `--help`)

Jun 11, 2021

A cross-platform OpenXR capabilities explorer and runtime switcher with a CLI and GUI.

A cross-platform OpenXR capabilities explorer and runtime switcher with a CLI and GUI.

OpenXR Explorer OpenXR Explorer is a handy debug tool for OpenXR developers. It allows for easy switching between OpenXR runtimes, shows lists of the

Jun 16, 2022

A Simple CLI Network Packet Sniffer

A Simple CLI Network Packet Sniffer

packt packt is a simple CL(command line) network packet sniffer which can run on any unix-like OS including termux (Android). packt works by first ope

Feb 7, 2022

CLI for the hangman game

 CLI for the hangman game

CLI for the hangman game Screenshots Demos failed attempt with genre set to animals succesful attempt with genre set to sports Details 100% C Code. Fe

Jan 10, 2022

Um CLI para encontrar os seus alias

Um CLI para encontrar os seus alias

Manager-Alias Que tal gerenciar todos os seus alias de um único local? Pesquisar e encontrar o que você precisa sem ter que ficar lendo diversos arqui

Oct 26, 2021

straightforward CLI tool for spectral analysis of sound files

dowser dowser is (presently) a quick and simple low-level utility for performing spectral analysis of sound files. usage dowser

Dec 18, 2021

Port of ani-cli with more features 😉

Port of ani-cli with more features 😉

May 19, 2022

A reimplementation of the OnionShare library and cli, written in C.

libonionshare A reimplementation of the OnionShare library and cli, written in C. The goal of this is to eventually port OnionShare to a flutter app u

Dec 30, 2021

CLI note-taking tool written in C

CLI note-taking tool written in C

Nota Nota, which means small note in arabic, is a simple note-taking CLI tool written entirely in C. It's written in only one file without the headach

Dec 14, 2021
Related tags
File packer for my games

cbfilegrabber2 File packer for my games still beta Usage cbfilegrabber2 [--zip|--package] <myassets.dat> --file <myassets.png> or cbfilegrabber2 --pac

Jan 5, 2022
File table expansion for The Legend of Zelda: Ocarina of Time.

z64ext <z64.me> SYNOPSIS z64ext is a file table expansion patch for The Legend of Zelda: Ocarina of Time. It is meant to be used in tandem

Nov 2, 2021
DxWrapper is a .dll file designed to wrap DirectX files to fix compatibility issues in older games

DxWrapper Introduction DxWrapper is a .dll file designed to wrap DirectX files to fix compatibility issues in older games. This project is primarily t

Jun 21, 2022
Sensirion Mass Flow Sensor Arduino library, modified from MyElectrons and Nabilphysics Arduino repositories for SFM3300 Digital Mass Flow Sensor
Sensirion Mass Flow Sensor Arduino library, modified from MyElectrons and Nabilphysics Arduino repositories for SFM3300 Digital Mass Flow Sensor

Sensirion Mass Flow Sensor Arduino library, modified from MyElectrons and Nabilphysics Arduino repositories for SFM3300 Digital Mass Flow Sensor. When the sensor data gets stuck, the library has a hard reset function to ensure that it is read continuously.

Apr 11, 2022
✔️The smallest header-only GUI library(4 KLOC) for all platforms
✔️The smallest header-only GUI library(4 KLOC) for all platforms

Welcome to GUI-lite The smallest header-only GUI library (4 KLOC) for all platforms. 中文 Lightweight ✂️ Small: 4,000+ lines of C++ code, zero dependenc

Jun 17, 2022
A small proxy DLL which enables dev. console in Mass Effect 1, 2 and 3 (Legendary Edition).
A small proxy DLL which enables dev. console in Mass Effect 1, 2 and 3 (Legendary Edition).

LEBinkProxy A small proxy DLL which enables dev. console in Mass Effect 1, 2 and 3 (Legendary Edition). Usage In your game binary directory (Game\ME?\

Jan 6, 2022
A C++ implementation of Fast Simulation of Mass-Spring Systems
A C++ implementation of Fast Simulation of Mass-Spring Systems

Fast Mass-Spring System Simulator A C++ implementation of Fast Simulation of Mass-Spring Systems [1], rendered with OpenGL. The dynamic inverse proced

Jun 5, 2022
The KISS file manager: CLI-based, ultra-lightweight, lightning fast, and written in C
 The KISS file manager: CLI-based, ultra-lightweight, lightning fast, and written in C

CliFM is a CLI-based, shell-like (non-curses) and KISS terminal file manager written in C: simple, fast, and lightweight as hell

Jun 14, 2022
A simple CLI to extract & save artwork of a 🎵 music/audio file.
A simple CLI to extract & save artwork of a 🎵 music/audio file.

artwork-extractor A simple CLI to extract & save artwork of a ?? music/audio file. Usage Dependencies MediaInfoLib On Debian based distros, one may in

Aug 4, 2021
A CLI for extracting libraries from Apple's dyld shared cache file

dyld-shared-cache-extractor As of macOS Big Sur, instead of shipping the system libraries with macOS, Apple ships a generated cache of all built in dy

Jun 15, 2022