Giter Site home page Giter Site logo

mvregex's Introduction

Description:
  Move or rename files that match the given regular expression.

Usage:
  mvregex [options] [--] SOURCE_REGEX DESTINATION_REGEX FILE...
  mvregex [options] --transliterate windows [--] FILE...

Options:
  --
    Stop parsing command options and process all remaining strings literally.
  -f, --force
    Do not prompt before overwriting files. Disabled by default, but writable
    files are still overwritten by default.
    Without this option, overwrite files that are writable, and only prompt for
    files that are not writable.
    With this option, overwrite all files without prompting.
    If you specify more than one of -f, -i, -n, only the final one takes effect.
    See -i or -n to disable overwriting existing files.
  -h, --help
    Display this help message and exit.
  -i, --interactive
    Prompt before overwriting files. Disabled by default.
    If you specify more than one of -f, -i, -n, only the final one takes effect.
  --merge
    Merge files into existing destination folders. Disabled by default.
  -n, --no-clobber
    Do not overwrite files. Disabled by default.
    If you specify more than one of -f, -i, -n, only the final one takes effect.
  --no-merge
    Disable --merge.
  --no-recursive
    Disable --recursive.
  -p, --pretend
    Perform a simulation only. No files are actually moved ore renamed.
    This option will increase the verbosity level to 2.
  -r, --recursive
    Process files in directories recursively. Disabled by default.
  --transliterate windows
    Convert characters into a string supported by windows:
      double quote '"' (ASCII 0x22) -> two single quotes "''" (ASCII 0x2727)
      colon ':' -> ratio '∶' U+2236 (UTF-8 0xE288B6)
      asterisk '*' -> heavy asterisk '✱' U+2731 (UTF-8 0xE29CB1)
      backslash '\' -> underscore '_'
      question mark '?' -> underscore '_'
      pipe '|' -> underscore '_'
      less than '<' -> underscore '_'
      greater than '>' -> underscore '_'
      remove trailing spaces (ASCII 0x20)
      remove trailing spaces (cygwin UTF-8 0xEF80A8)
      remove trailing period (ASCII 0x2E)
      remove trailing period (cygwin UTF-8 0xEF80A9)
    Convert strings into a format supported by windows:
      s/^ *$/_space_/
  -v
    Increase the verbosity level by 1.
  --verbose #
    Use more or less verbose output. Valid values are:
      0  Default. No output.
      1  Show only renamed files.
      2  Show subfiles that are moved during a folder merge.
      3  Show all files.

Examples:
  Convert "JPG" extension to "jpg"
    mvregex -p -v '[jJ][pP][eE]?[gG]$' 'jpg' *
  Convert "###" to "S#E##"
    mvregex -p -v '^([0-9])([0-9][0-9])' 'S\1E\2' *.mkv
  Convert upper case to lower case
    mvregex -p -v '(.*)' '\L\1' *
  Convert lower case to upper case
    mvregex -p -v '(.*)' '\U\1' *
  Remove trailing spaces on all files recursively
    mvregex -p -r '^(.*) +$' '\1' *
  Remove trailing spaces (cygwin encoded byte sequence EF80A8) on all files recursively
    mvregex -p -r '^(.*)\xEF\x80\xA8$' '\1' *
  Remove trailing . on all files recursively
    mvregex -p -r '^(.*)\.+$' '\1' *
  Remove trailing . (cygwin encoded byte sequence EF80A9) on all files recursively
    mvregex -p -r '^(.*)\xEF\x80\xA9$' '\1' *

Version:
  mvregex 2.5.1.0
  Copyright (C) 2007 Nathan Shearer
  Licensed under GNU General Public License 2.0

mvregex's People

Contributors

nathanshearer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.