Coder Social home page Coder Social logo

remv's Introduction

remv

Rename files with regular expressions.

This application aims to solve the problem that renaming files with regular expressions sucks dicks in hell.

The current approach to the problem:

ls * | sed -E 's/(.*)text(.*)to(.*)remove(.*)/mv & "$1$2$3$4"/' | sh

If you think this is handy, please seek help.

The remv approach to the problem:

remv "(.*)text(.*)to(.*)remove(.*)" "$1$2$3$4"

How to compile:

Get remv from the Fossil repository or on whichever mirror you read this.

Grab clang for your OS (we expect C++20 or newer), then:

clang -std=c++20 src/remv.cpp

Or, on Windows:

.\build.cmd

Enjoy.

How to use it:

 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.

Comments?

remv's People

Stargazers

Jan Killian avatar

Watchers

Cthulhux avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.