DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: N.A.N.Y. 2019: remv: Rename files (and directories) with regular expressions  (Read 15,310 times)

Tuxman

  • OMG not him again!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,522
    • Participated in NANY Challenge Seven Times
Just throwing together my other 2019 applications before writing new ones...

NANY 2019 Entry Information

Application Name remv
Version 2.0.0
Short Description A sane way to rename files/directories with a regular expression.
Supported OSes Any, as long as we have a C++17 compiler.
Web Page https://www.donationcoder.com/forum/index.php?topic=44941
Download Link Attached in the "website" topic.
System Requirements
  • Binary: Windows.
  • Compile yourself: Any that has a new(ish) Clang compiler set.
Version History
  • check constants.hpp
Author whatever

Description
remv should solve my regular problem of having to recursively rename files according to a regex pattern.

Features
- Renames files and folders.
- Can simulate that as well.

Screenshots

(Sorry - attachments don't currently work.)

Usage
Installation
Unpack the .exe anywhere (or build one wherever you want).

Using the Application
Code
 USAGE:
        remv [COMMANDS]
        remv [OPTIONS] <regex> <replacement> [<startpath>]

 OPTIONS (any combination):
        -r      Recurse into subdirectories.
        -E      Skip file extensions while renaming.
        -d      Also rename directories on the way.
        -s      Sets the start directory to the last parameter;
                else, remv will start in '.'.
        -f      Only replaces the first occurrence in each name.
        -v      Verbose logging.
        -vv     Very verbose logging.
        -n      Dry run - don't modify anything just yet.

 COMMANDS:
        -V      Display the remv version and exit.
        -h      Display this help screen and exit.

 You can use $1, $2 etc. in your replacement strings for back-
 references.

Uninstallation
Delete the executable file. You might want to add its path to your %PATH% if you want easier access.

Tips
Don't.  ;D

Known Issues
It sucks!
I bet when Cheetahs race and one of them cheats, the other one goes "Man, you're such a Cheetah!" and they laugh & eat a zebra or whatever.
« Last Edit: June 01, 2022, 02:26 PM by Tuxman »

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Intriguing...and I look forward to using it in the future should the need arise.  :Thmbsup:

Tuxman

  • OMG not him again!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,522
    • Participated in NANY Challenge Seven Times
Thank you!  :)
I bet when Cheetahs race and one of them cheats, the other one goes "Man, you're such a Cheetah!" and they laugh & eat a zebra or whatever.

Lintalist

  • Participant
  • Joined in 2015
  • *
  • Posts: 122
Nice - Reminds me of a program I used long ago, called gren (which was just a compiled perl script afaik).
Archived page here http://web.archive.org/web/20021202122701/http://www.geocities.com/gkarpo/gren/gren.html (from 2002)
"GREN can do all things DOS's RENAME can. However, GREN's power comes from being able to understand Perl's regular expressions (REGEXPs)."

I still have the program although I haven't used it this decade - attached for those interested as the archived download link might not work.

Tuxman

  • OMG not him again!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,522
    • Participated in NANY Challenge Seven Times
Never heard of that! Too late now - damn.
I bet when Cheetahs race and one of them cheats, the other one goes "Man, you're such a Cheetah!" and they laugh & eat a zebra or whatever.

Original address: https://www.donationcoder.com/forum/index.php?topic=45923.0